]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
Fix notification settings
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / my-account-settings / my-account-notification-preferences / my-account-notification-preferences.component.ts
index 8faba676e928f9e95dd4b3fcd008808b6433144f..2adc276a91f3f8219a3c946a6b7d394b219e9b03 100644 (file)
@@ -3,6 +3,7 @@ import { Subject } from 'rxjs'
 import { Component, Input, OnInit } from '@angular/core'
 import { Notifier, ServerService, User } from '@app/core'
 import { UserNotificationService } from '@app/shared/shared-main'
+import { objectKeysTyped } from '@shared/core-utils'
 import { UserNotificationSetting, UserNotificationSettingValue, UserRight } from '@shared/models'
 
 @Component({
@@ -141,7 +142,7 @@ export class MyAccountNotificationPreferencesComponent implements OnInit {
   }
 
   private loadNotificationSettings () {
-    for (const key of Object.keys(this.user.notificationSettings) as (keyof UserNotificationSetting)[]) {
+    for (const key of objectKeysTyped(this.user.notificationSettings)) {
       const value = this.user.notificationSettings[key]
       this.emailNotifications[key] = !!(value & UserNotificationSettingValue.EMAIL)