aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-15 15:19:41 +0100
committerChocobozzz <me@florianbigard.com>2022-03-15 15:19:41 +0100
commitff6a266e3f5cb740770a2a186bdfdd0cb871e174 (patch)
tree919c4d0d8e81719388a62971c5501dc6139c216d /client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
parentb46489f8e412bed010a00fb9995dc2f84220fc5a (diff)
downloadPeerTube-ff6a266e3f5cb740770a2a186bdfdd0cb871e174.tar.gz
PeerTube-ff6a266e3f5cb740770a2a186bdfdd0cb871e174.tar.zst
PeerTube-ff6a266e3f5cb740770a2a186bdfdd0cb871e174.zip
Clearer theme select labels
Diffstat (limited to 'client/src/app/shared/shared-user-settings/user-interface-settings.component.ts')
-rw-r--r--client/src/app/shared/shared-user-settings/user-interface-settings.component.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
index d04a2c348..932db498a 100644
--- a/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
+++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
@@ -2,6 +2,7 @@ import { Subject, Subscription } from 'rxjs'
2import { Component, Input, OnDestroy, OnInit } from '@angular/core' 2import { Component, Input, OnDestroy, OnInit } from '@angular/core'
3import { AuthService, Notifier, ServerService, UserService } from '@app/core' 3import { AuthService, Notifier, ServerService, UserService } from '@app/core'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
5import { capitalizeFirstLetter } from '@root-helpers/string'
5import { HTMLServerConfig, User, UserUpdateMe } from '@shared/models' 6import { HTMLServerConfig, User, UserUpdateMe } from '@shared/models'
6 7
7@Component({ 8@Component({
@@ -17,6 +18,8 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
17 18
18 formValuesWatcher: Subscription 19 formValuesWatcher: Subscription
19 20
21 defaultThemeLabel = $localize`Light/Orange`
22
20 private serverConfig: HTMLServerConfig 23 private serverConfig: HTMLServerConfig
21 24
22 constructor ( 25 constructor (
@@ -57,6 +60,18 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
57 this.formValuesWatcher?.unsubscribe() 60 this.formValuesWatcher?.unsubscribe()
58 } 61 }
59 62
63 getDefaultThemeLabel () {
64 const theme = this.serverConfig.theme.default
65
66 if (theme === 'default') return this.defaultThemeLabel
67
68 return theme
69 }
70
71 capitalizeFirstLetter (str: string) {
72 return capitalizeFirstLetter(str)
73 }
74
60 updateInterfaceSettings () { 75 updateInterfaceSettings () {
61 const theme = this.form.value['theme'] 76 const theme = this.form.value['theme']
62 77