X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bmy-account%2Fmy-account-settings%2Fmy-account-video-settings%2Fmy-account-video-settings.component.ts;h=b8f80bc1a344527ae0ab56c807a54a13e01158e0;hb=f8b2c1b4f509c037b9650cca2c5befd21f056df3;hp=9e711a227be7144cf16e45bf08fa80bd6017405c;hpb=64cc5e8575fda47b281ae20abf0020e27fc8ce7c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts index 9e711a227..b8f80bc1a 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core' -import { NotificationsService } from 'angular2-notifications' +import { Notifier } from '@app/core' import { UserUpdateMe } from '../../../../../../shared' import { AuthService } from '../../../core' import { FormReactive, User, UserService } from '../../../shared' @@ -19,7 +19,7 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI constructor ( protected formValidatorService: FormValidatorService, private authService: AuthService, - private notificationsService: NotificationsService, + private notifier: Notifier, private userService: UserService, private i18n: I18n ) { @@ -29,14 +29,14 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI ngOnInit () { this.buildForm({ nsfwPolicy: null, - webTorrentPolicy: null, + webTorrentEnabled: null, autoPlayVideo: null }) this.userInformationLoaded.subscribe(() => { this.form.patchValue({ nsfwPolicy: this.user.nsfwPolicy, - webTorrentPolicy: this.user.webTorrentPolicy, + webTorrentEnabled: this.user.webTorrentEnabled, autoPlayVideo: this.user.autoPlayVideo === true }) }) @@ -44,22 +44,22 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI updateDetails () { const nsfwPolicy = this.form.value['nsfwPolicy'] - const webTorrentPolicy = this.form.value['webTorrentPolicy'] + const webTorrentEnabled = this.form.value['webTorrentEnabled'] const autoPlayVideo = this.form.value['autoPlayVideo'] const details: UserUpdateMe = { nsfwPolicy, - webTorrentPolicy, + webTorrentEnabled, autoPlayVideo } this.userService.updateMyProfile(details).subscribe( () => { - this.notificationsService.success(this.i18n('Success'), this.i18n('Information updated.')) + this.notifier.success(this.i18n('Information updated.')) this.authService.refreshUserInformation() }, - err => this.notificationsService.error(this.i18n('Error'), err.message) + err => this.notifier.error(err.message) ) } }