-import { Subject } from 'rxjs'
import { tap } from 'rxjs/operators'
import { Component, ComponentFactoryResolver, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
onVideosHistoryChange () {
this.userService.updateMyProfile({ videosHistoryEnabled: this.videosHistoryEnabled })
- .subscribe(
- () => {
- const message = this.videosHistoryEnabled === true ?
- $localize`Videos history is enabled` :
- $localize`Videos history is disabled`
+ .subscribe({
+ next: () => {
+ const message = this.videosHistoryEnabled === true
+ ? $localize`Videos history is enabled`
+ : $localize`Videos history is disabled`
this.notifier.success(message)
this.authService.refreshUserInformation()
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
async deleteHistory () {
if (res !== true) return
this.userHistoryService.deleteUserVideosHistory()
- .subscribe(
- () => {
+ .subscribe({
+ next: () => {
this.notifier.success($localize`Videos history deleted`)
this.reloadData()
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
}