diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-videos/my-account-videos.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account-videos/my-account-videos.component.ts | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts index c1b53bcd5..d8c919fee 100644 --- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts +++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts | |||
@@ -1,12 +1,11 @@ | |||
1 | import { Component, OnInit, OnDestroy } from '@angular/core' | 1 | import { from as observableFrom, Observable } from 'rxjs' |
2 | import { concatAll, tap } from 'rxjs/operators' | ||
3 | import { Component, OnDestroy, OnInit } from '@angular/core' | ||
2 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { Location } from '@angular/common' | 5 | import { Location } from '@angular/common' |
4 | import { immutableAssign } from '@app/shared/misc/utils' | 6 | import { immutableAssign } from '@app/shared/misc/utils' |
5 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | 7 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' |
6 | import { NotificationsService } from 'angular2-notifications' | 8 | import { NotificationsService } from 'angular2-notifications' |
7 | import 'rxjs/add/observable/from' | ||
8 | import 'rxjs/add/operator/concatAll' | ||
9 | import { Observable } from 'rxjs/Observable' | ||
10 | import { AuthService } from '../../core/auth' | 9 | import { AuthService } from '../../core/auth' |
11 | import { ConfirmService } from '../../core/confirm' | 10 | import { ConfirmService } from '../../core/confirm' |
12 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 11 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' |
@@ -78,14 +77,14 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni | |||
78 | const observables: Observable<any>[] = [] | 77 | const observables: Observable<any>[] = [] |
79 | for (const videoId of toDeleteVideosIds) { | 78 | for (const videoId of toDeleteVideosIds) { |
80 | const o = this.videoService | 79 | const o = this.videoService |
81 | .removeVideo(videoId) | 80 | .removeVideo(videoId) |
82 | .do(() => this.spliceVideosById(videoId)) | 81 | .pipe(tap(() => this.spliceVideosById(videoId))) |
83 | 82 | ||
84 | observables.push(o) | 83 | observables.push(o) |
85 | } | 84 | } |
86 | 85 | ||
87 | Observable.from(observables) | 86 | observableFrom(observables).pipe( |
88 | .concatAll() | 87 | concatAll()) |
89 | .subscribe( | 88 | .subscribe( |
90 | res => { | 89 | res => { |
91 | this.notificationsService.success('Success', `${toDeleteVideosIds.length} videos deleted.`) | 90 | this.notificationsService.success('Success', `${toDeleteVideosIds.length} videos deleted.`) |