]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts
add webtorrent opt-out settings
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / my-account-settings / my-account-video-settings / my-account-video-settings.component.ts
index 85b3a48cc728b60fb411d1913af764c345bb6717..9e711a227be7144cf16e45bf08fa80bd6017405c 100644 (file)
@@ -5,7 +5,7 @@ import { AuthService } from '../../../core'
 import { FormReactive, User, UserService } from '../../../shared'
 import { I18n } from '@ngx-translate/i18n-polyfill'
 import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
-import { Subject } from 'rxjs/Subject'
+import { Subject } from 'rxjs'
 
 @Component({
   selector: 'my-account-video-settings',
@@ -29,22 +29,26 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI
   ngOnInit () {
     this.buildForm({
       nsfwPolicy: null,
+      webTorrentPolicy: null,
       autoPlayVideo: null
     })
 
     this.userInformationLoaded.subscribe(() => {
       this.form.patchValue({
         nsfwPolicy: this.user.nsfwPolicy,
-        autoPlayVideo: this.user.autoPlayVideo === true ? 'true' : 'false'
+        webTorrentPolicy: this.user.webTorrentPolicy,
+        autoPlayVideo: this.user.autoPlayVideo === true
       })
     })
   }
 
   updateDetails () {
     const nsfwPolicy = this.form.value['nsfwPolicy']
+    const webTorrentPolicy = this.form.value['webTorrentPolicy']
     const autoPlayVideo = this.form.value['autoPlayVideo']
     const details: UserUpdateMe = {
       nsfwPolicy,
+      webTorrentPolicy,
       autoPlayVideo
     }