Skip to content

Commit dde5056

Browse files
authored
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.
1 parent 406879f commit dde5056

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frontend/src/features/crawl-workflows/workflow-editor.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ export class WorkflowEditor extends BtrixElement {
195195
@property({ type: Object })
196196
initialWorkflow?: WorkflowParams;
197197

198+
private updatingScopeType = false;
199+
198200
@property({ type: Array })
199201
initialSeeds?: Seed[];
200202

@@ -293,7 +295,11 @@ export class WorkflowEditor extends BtrixElement {
293295
changedProperties: PropertyValues<this> & Map<string, unknown>,
294296
) {
295297
if (changedProperties.get("initialWorkflow") && this.initialWorkflow) {
296-
this.initializeEditor();
298+
if (this.updatingScopeType) {
299+
this.updatingScopeType = false;
300+
} else {
301+
this.initializeEditor();
302+
}
297303
}
298304
if (changedProperties.get("progressState") && this.progressState) {
299305
if (
@@ -1715,6 +1721,7 @@ https://archiveweb.page/images/${"logo.svg"}`}
17151721

17161722
if (!this.configId) {
17171723
// Remember scope type for new workflows
1724+
this.updatingScopeType = true;
17181725
AppStateService.partialUpdateUserPreferences({
17191726
newWorkflowScopeType: value,
17201727
});

0 commit comments

Comments
 (0)