diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-18 15:31:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-18 15:40:59 +0100 |
commit | ba430d7516bc5b1324b60571ba7594460969b7fb (patch) | |
tree | df5c6952c82f49a94c0a884bbc97d4a0cbd9f867 /client/src/app/+my-account/my-account-settings/my-account-notification-preferences | |
parent | 5dfb7c1dec8222b0bbccac5b56ad46da1438747e (diff) | |
download | PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.gz PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.zst PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.zip |
Lazy load static objects
Diffstat (limited to 'client/src/app/+my-account/my-account-settings/my-account-notification-preferences')
-rw-r--r-- | client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts index 76fabb19d..6ba1a1020 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts | |||
@@ -21,7 +21,7 @@ export class MyAccountNotificationPreferencesComponent implements OnInit { | |||
21 | webNotifications: { [ id in keyof UserNotificationSetting ]: boolean } = {} as any | 21 | webNotifications: { [ id in keyof UserNotificationSetting ]: boolean } = {} as any |
22 | labelNotifications: { [ id in keyof UserNotificationSetting ]: string } = {} as any | 22 | labelNotifications: { [ id in keyof UserNotificationSetting ]: string } = {} as any |
23 | rightNotifications: { [ id in keyof Partial<UserNotificationSetting> ]: UserRight } = {} as any | 23 | rightNotifications: { [ id in keyof Partial<UserNotificationSetting> ]: UserRight } = {} as any |
24 | emailEnabled: boolean | 24 | emailEnabled = false |
25 | 25 | ||
26 | private savePreferences = debounce(this.savePreferencesImpl.bind(this), 500) | 26 | private savePreferences = debounce(this.savePreferencesImpl.bind(this), 500) |
27 | 27 | ||
@@ -31,7 +31,6 @@ export class MyAccountNotificationPreferencesComponent implements OnInit { | |||
31 | private serverService: ServerService, | 31 | private serverService: ServerService, |
32 | private notifier: Notifier | 32 | private notifier: Notifier |
33 | ) { | 33 | ) { |
34 | |||
35 | this.labelNotifications = { | 34 | this.labelNotifications = { |
36 | newVideoFromSubscription: this.i18n('New video from your subscriptions'), | 35 | newVideoFromSubscription: this.i18n('New video from your subscriptions'), |
37 | newCommentOnMyVideo: this.i18n('New comment on your video'), | 36 | newCommentOnMyVideo: this.i18n('New comment on your video'), |
@@ -55,11 +54,14 @@ export class MyAccountNotificationPreferencesComponent implements OnInit { | |||
55 | newInstanceFollower: UserRight.MANAGE_SERVER_FOLLOW, | 54 | newInstanceFollower: UserRight.MANAGE_SERVER_FOLLOW, |
56 | autoInstanceFollowing: UserRight.MANAGE_CONFIGURATION | 55 | autoInstanceFollowing: UserRight.MANAGE_CONFIGURATION |
57 | } | 56 | } |
58 | |||
59 | this.emailEnabled = this.serverService.getConfig().email.enabled | ||
60 | } | 57 | } |
61 | 58 | ||
62 | ngOnInit () { | 59 | ngOnInit () { |
60 | this.serverService.getConfig() | ||
61 | .subscribe(config => { | ||
62 | this.emailEnabled = config.email.enabled | ||
63 | }) | ||
64 | |||
63 | this.userInformationLoaded.subscribe(() => this.loadNotificationSettings()) | 65 | this.userInformationLoaded.subscribe(() => this.loadNotificationSettings()) |
64 | } | 66 | } |
65 | 67 | ||