Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
fix: download component do not show version
Browse files Browse the repository at this point in the history
Change-Id: Ia3d3fc92961565831883f717f54cb4feed2da699
  • Loading branch information
myml committed Nov 16, 2018
1 parent 7a65831 commit dc55516
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
</ng-template>

<div class="list"
*ngIf="loadCount >= 2; else: loading">
*ngIf="loaded; else: loading">
<div class="title"
i18n>Processing {{ jobs.length }} {jobs.length, plural,=0 {task} =1 {task} other {tasks}}</div>

<table>
<ng-container *ngFor="let job of jobs">
<ng-container *ngFor="let appName of job.names">
<tr *ngIf="apps.get(appName) as $app"
<tr *ngIf="appName|appInfo|async as $app"
@flyInOut>
<td><img class="icon"
[src]="$app | icon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,18 @@ export class DownloadComponent implements OnInit, OnDestroy {
start = this.storeService.resumeJob;
pause = this.storeService.pauseJob;

loadCount = 0;
loaded = false;
apps = new Map<string, App>();
jobs: StoreJobInfo[] = [];
cancels = new Set<string>();
jobs$: Subscription;
fixing = false;

ngOnInit() {
this.appService.list().subscribe(apps => {
apps.forEach(app => {
this.apps.set(app.name, app);
});
this.loadCount++;
});

this.jobs$ = this.jobService.jobsInfo().subscribe(jobs => {
jobs = jobs.filter(
job => job.type === StoreJobType.download || job.type === StoreJobType.install,
);
this.loadCount++;
const list = jobs.map(job => job.id);
this.jobs.forEach((job, index) => {
if (!list.includes(job.id)) {
Expand All @@ -76,6 +68,7 @@ export class DownloadComponent implements OnInit, OnDestroy {
this.jobs.unshift(job);
}
});
this.loaded = true;
});
}

Expand Down

0 comments on commit dc55516

Please sign in to comment.