From f250293794f8c9593a067d9a38e22a4c394a8b17 Mon Sep 17 00:00:00 2001 From: sua yoo Date: Thu, 11 May 2023 22:33:35 -0700 Subject: [PATCH] Fix workflow edit page not loading (#848) * fix workflow not loading * don't add hash if editing * remove controller --- frontend/src/pages/org/workflow-detail.ts | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/frontend/src/pages/org/workflow-detail.ts b/frontend/src/pages/org/workflow-detail.ts index cb4337a8..1fa74abc 100644 --- a/frontend/src/pages/org/workflow-detail.ts +++ b/frontend/src/pages/org/workflow-detail.ts @@ -103,8 +103,6 @@ export class WorkflowDetail extends LiteElement { private isPanelHeaderVisible?: boolean; - // Use to cancel requests - private getWorkflowController: AbortController | null = null; private getWorkflowPromise?: Promise; private readonly jobTypeLabels: Record = { @@ -173,6 +171,8 @@ export class WorkflowDetail extends LiteElement { } private getActivePanelFromHash = () => { + if (this.isEditing) return; + const hashValue = window.location.hash.slice(1); if (SECTIONS.includes(hashValue as any)) { this.activePanel = hashValue as Tab; @@ -265,13 +265,6 @@ export class WorkflowDetail extends LiteElement { } } - private cancelInProgressGetWorkflow() { - if (this.getWorkflowController) { - this.getWorkflowController.abort(ABORT_REASON_CANCLED); - this.getWorkflowController = null; - } - } - render() { if (this.isEditing && this.isCrawler) { return html` @@ -1196,15 +1189,10 @@ export class WorkflowDetail extends LiteElement { } private async getWorkflow(): Promise { - this.getWorkflowController = new AbortController(); const data: Workflow = await this.apiFetch( `/orgs/${this.orgId}/crawlconfigs/${this.workflowId}`, - this.authState!, - { - signal: this.getWorkflowController.signal, - } + this.authState! ); - this.getWorkflowController = null; return data; } @@ -1254,7 +1242,6 @@ export class WorkflowDetail extends LiteElement { private stopPoll() { window.clearTimeout(this.timerId); - this.cancelInProgressGetWorkflow(); } private async getCrawl(crawlId: Crawl["id"]): Promise {