import { first } from 'rxjs/operators'
import { Component, Input, OnDestroy, OnInit } from '@angular/core'
import { AuthService, Notifier, ServerService, User, UserService } from '@app/core'
-import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
+import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
import { UserUpdateMe } from '@shared/models'
import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type'
formValuesWatcher: Subscription
constructor (
- protected formValidatorService: FormValidatorService,
+ protected formReactiveService: FormReactiveService,
private authService: AuthService,
private notifier: Notifier,
private userService: UserService,
ngOnInit () {
this.buildForm({
nsfwPolicy: null,
- webTorrentEnabled: null,
+ p2pEnabled: null,
autoPlayVideo: null,
autoPlayNextVideo: null,
videoLanguages: null
this.form.patchValue({
nsfwPolicy: this.user.nsfwPolicy || this.defaultNSFWPolicy,
- webTorrentEnabled: this.user.webTorrentEnabled,
+ p2pEnabled: this.user.p2pEnabled,
autoPlayVideo: this.user.autoPlayVideo === true,
autoPlayNextVideo: this.user.autoPlayNextVideo,
videoLanguages: this.user.videoLanguages
updateDetails (onlyKeys?: string[]) {
const nsfwPolicy = this.form.value['nsfwPolicy']
- const webTorrentEnabled = this.form.value['webTorrentEnabled']
+ const p2pEnabled = this.form.value['p2pEnabled']
const autoPlayVideo = this.form.value['autoPlayVideo']
const autoPlayNextVideo = this.form.value['autoPlayNextVideo']
let details: UserUpdateMe = {
nsfwPolicy,
- webTorrentEnabled,
+ p2pEnabled,
autoPlayVideo,
autoPlayNextVideo,
videoLanguages