add webtorrent opt-out settings
[oweals/peertube.git] / client / src / app / +my-account / my-account-settings / my-account-video-settings / my-account-video-settings.component.ts
index 7089b20572234249790eccb29329a522462fa171..9e711a227be7144cf16e45bf08fa80bd6017405c 100644 (file)
@@ -29,12 +29,14 @@ 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,
+        webTorrentPolicy: this.user.webTorrentPolicy,
         autoPlayVideo: this.user.autoPlayVideo === true
       })
     })
@@ -42,9 +44,11 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI
 
   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
     }