ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix notification settings
Chocobozzzf9735a9e88ff
diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.html b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.htmlindex 46f5e5d6b1..2af9d576ac 100644--- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.html+++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.html@@ -12,6 +12,7 @@<div><my-input-switch+ [inputName]="'web-notification-' + notificationType"[(ngModel)]="webNotifications[notificationType]"(ngModelChange)="updateWebSetting(notificationType, webNotifications[notificationType])"></my-input-switch>@@ -19,6 +20,7 @@<div *ngIf="emailEnabled"><my-input-switch+ [inputName]="'email-notification-' + notificationType"[(ngModel)]="emailNotifications[notificationType]"(ngModelChange)="updateEmailSetting(notificationType, emailNotifications[notificationType])"></my-input-switch>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.tsindex 8faba676e9..2adc276a91 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@@ -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)diff --git a/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.html b/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.htmlindex 2bbe26c96d..59ee57b16d 100644--- a/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.html+++ b/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.html@@ -7,7 +7,7 @@[ngbTooltip]="autoPlayNextVideoTooltip" placement="bottom-right auto"><span i18n>AUTOPLAY</span>- <my-input-switch class="small" [(ngModel)]="autoPlayNextVideo" (ngModelChange)="switchAutoPlayNextVideo()"></my-input-switch>+ <my-input-switch class="small" inputName="autoplay-next-video" [(ngModel)]="autoPlayNextVideo" (ngModelChange)="switchAutoPlayNextVideo()"></my-input-switch></div></div>diff --git a/client/src/app/menu/menu.component.html b/client/src/app/menu/menu.component.htmlindex 10b3f15d90..c23bb4f5bc 100644--- a/client/src/app/menu/menu.component.html+++ b/client/src/app/menu/menu.component.html@@ -61,7 +61,7 @@<my-global-icon iconName="p2p" aria-hidden="true"></my-global-icon><ng-container i18n>Help share videos</ng-container>- <my-input-switch class="ms-auto" [checked]="user.p2pEnabled"></my-input-switch>+ <my-input-switch inputName="p2p-enabled" class="ms-auto" [checked]="user.p2pEnabled"></my-input-switch></button><div class="dropdown-divider"></div>diff --git a/client/src/app/shared/shared-forms/input-switch.component.ts b/client/src/app/shared/shared-forms/input-switch.component.tsindex abb96de624..f340ce81e8 100644--- a/client/src/app/shared/shared-forms/input-switch.component.ts+++ b/client/src/app/shared/shared-forms/input-switch.component.ts@@ -20,6 +20,7 @@ export class InputSwitchComponent implements ControlValueAccessor {propagateChange = (_: any) => { /* empty */ }writeValue (checked: boolean) {+ console.log(checked)this.checked = checked}@@ -32,6 +33,7 @@ export class InputSwitchComponent implements ControlValueAccessor {}update () {+ console.log(this.checked)this.checked = !this.checkedthis.propagateChange(this.checked)}