From 1d178c70bd2395a818bbc48b4294f518fd276e9e Mon Sep 17 00:00:00 2001 From: ElonH Date: Thu, 21 May 2020 21:41:25 +0800 Subject: [PATCH] fix(list-view): isLoading set false whatever error is arised --- .../manager/fileMode/listView/listView.component.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app/pages/manager/fileMode/listView/listView.component.ts b/src/app/pages/manager/fileMode/listView/listView.component.ts index 6f7548b..fc95a81 100644 --- a/src/app/pages/manager/fileMode/listView/listView.component.ts +++ b/src/app/pages/manager/fileMode/listView/listView.component.ts @@ -2,7 +2,6 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; import { Columns, Config, DefaultConfig } from 'ngx-easy-table'; import { OperationsListFlowOutItemNode } from 'src/app/@dataflow/rclone'; import { OperationsListService } from '../operations-list.service'; -import { filter } from 'rxjs/operators'; import { Subscription } from 'rxjs'; @Component({ @@ -20,12 +19,11 @@ export class ListViewComponent implements OnInit, OnDestroy { constructor(private listService: OperationsListService) {} - visable = false; ngOnInit() { - this.visable = true; - this.listScrb = this.listService.list$.pipe(filter(() => this.visable)).subscribe((x) => { - this.data = x.list; + this.listScrb = this.listService.listFlow$.getOutput().subscribe((x) => { this.configuration.isLoading = false; + if (x[1].length !== 0) return; + this.data = x[0].list; }); this.listService.listTrigger.next(1); @@ -43,7 +41,6 @@ export class ListViewComponent implements OnInit, OnDestroy { private listScrb: Subscription; ngOnDestroy() { - this.visable = false; this.listScrb.unsubscribe(); } }