X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bmy-library%2Fmy-history%2Fmy-history.component.ts;h=a72d22e1c4b1a44f4a5db1150f27be4ebecc8c64;hb=9df52d660feb722404be00a50f3c8a612bec1c15;hp=ad83db7abc41bfbd6e267b0f10f5615fdcee9636;hpb=2e46eb97154da909b82d5efe1d336a3412594ff0;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+my-library/my-history/my-history.component.ts b/client/src/app/+my-library/my-history/my-history.component.ts index ad83db7ab..a72d22e1c 100644 --- a/client/src/app/+my-library/my-history/my-history.component.ts +++ b/client/src/app/+my-library/my-history/my-history.component.ts @@ -1,4 +1,3 @@ -import { Subject } from 'rxjs' import { tap } from 'rxjs/operators' import { Component, ComponentFactoryResolver, OnInit, ViewChild } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' @@ -107,19 +106,19 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { 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 () { @@ -130,14 +129,14 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { 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) + }) } }