From dde5056242aa2fdc0421b54823454deb9eebd26e Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Mon, 7 Oct 2024 13:05:23 -0700 Subject: [PATCH] quickfix: add a flag to avoid clearing primarySeedUrl when switching scope types (#2104) otherwise, triggers a partial state update, which causes a form to be reset. --- frontend/src/features/crawl-workflows/workflow-editor.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/features/crawl-workflows/workflow-editor.ts b/frontend/src/features/crawl-workflows/workflow-editor.ts index 7545cd63..6e9fc1ef 100644 --- a/frontend/src/features/crawl-workflows/workflow-editor.ts +++ b/frontend/src/features/crawl-workflows/workflow-editor.ts @@ -195,6 +195,8 @@ export class WorkflowEditor extends BtrixElement { @property({ type: Object }) initialWorkflow?: WorkflowParams; + private updatingScopeType = false; + @property({ type: Array }) initialSeeds?: Seed[]; @@ -293,7 +295,11 @@ export class WorkflowEditor extends BtrixElement { changedProperties: PropertyValues & Map, ) { if (changedProperties.get("initialWorkflow") && this.initialWorkflow) { - this.initializeEditor(); + if (this.updatingScopeType) { + this.updatingScopeType = false; + } else { + this.initializeEditor(); + } } if (changedProperties.get("progressState") && this.progressState) { if ( @@ -1715,6 +1721,7 @@ https://archiveweb.page/images/${"logo.svg"}`} if (!this.configId) { // Remember scope type for new workflows + this.updatingScopeType = true; AppStateService.partialUpdateUserPreferences({ newWorkflowScopeType: value, });