From db400f447a9f7aae1c56fa25396e93069744483f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 15 May 2018 11:55:51 +0200 Subject: Upgrade to rxjs 6 --- .../my-account-videos/my-account-videos.component.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'client/src/app/+my-account/my-account-videos/my-account-videos.component.ts') 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 @@ -import { Component, OnInit, OnDestroy } from '@angular/core' +import { from as observableFrom, Observable } from 'rxjs' +import { concatAll, tap } from 'rxjs/operators' +import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { Location } from '@angular/common' import { immutableAssign } from '@app/shared/misc/utils' import { ComponentPagination } from '@app/shared/rest/component-pagination.model' import { NotificationsService } from 'angular2-notifications' -import 'rxjs/add/observable/from' -import 'rxjs/add/operator/concatAll' -import { Observable } from 'rxjs/Observable' import { AuthService } from '../../core/auth' import { ConfirmService } from '../../core/confirm' import { AbstractVideoList } from '../../shared/video/abstract-video-list' @@ -78,14 +77,14 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni const observables: Observable[] = [] for (const videoId of toDeleteVideosIds) { const o = this.videoService - .removeVideo(videoId) - .do(() => this.spliceVideosById(videoId)) + .removeVideo(videoId) + .pipe(tap(() => this.spliceVideosById(videoId))) observables.push(o) } - Observable.from(observables) - .concatAll() + observableFrom(observables).pipe( + concatAll()) .subscribe( res => { this.notificationsService.success('Success', `${toDeleteVideosIds.length} videos deleted.`) -- cgit v1.2.3