diff --git a/src/app/pages/explorer-page/explorer-page.component.ts b/src/app/pages/explorer-page/explorer-page.component.ts index 10bf972b1f0c1d0707e421835bc6cd92e9e1b981..3f2e7700c69e917b864c186e5d4287083a0aeb1d 100644 --- a/src/app/pages/explorer-page/explorer-page.component.ts +++ b/src/app/pages/explorer-page/explorer-page.component.ts @@ -359,10 +359,10 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { } public graphmlLink() { - const data = {nodes: this.nodeData.nodes.get(), edges: this.nodeData.edges.get()} + const data = {nodes: this.nodeData.nodes.get(), edges: this.nodeData.edges.get()}; this.netex.graphmlLink(data).subscribe(response => { return downLoadFile(response, "application/xml"); - }) + }); } public async openSummary(item: Wrapper, zoom: boolean) { diff --git a/src/app/services/analysis/analysis.service.ts b/src/app/services/analysis/analysis.service.ts index 05835f1b4b662e72a5a6e29655fb0ee6260c8185..5278217da0bb3fa72242db3437416c039eb55b76 100644 --- a/src/app/services/analysis/analysis.service.ts +++ b/src/app/services/analysis/analysis.service.ts @@ -100,7 +100,7 @@ export class AnalysisService { } async getTasks() { - return await this.netex.getTasks(this.tokens).catch((e) => { + return await this.netex.getTasks(this.finishedTokens.length > 0 && this.tasks.length === 0 ? this.tokens : this.tokens.filter(t => this.finishedTokens.indexOf(t) === -1)).catch((e) => { clearInterval(this.intervalId); }); } @@ -357,7 +357,11 @@ export class AnalysisService { startWatching() { const watch = async () => { if (this.tokens.length > 0) { - this.tasks = await this.getTasks(); + const newtasks = await this.getTasks(); + if (newtasks.length === 0) + return; + const newTaskIds = newtasks.map(t => t.token.toString()); + this.tasks = newtasks.concat(this.tasks.filter(t => newTaskIds.indexOf(t.token) === -1)); if (!this.tasks) { return; }