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.
This commit is contained in:
Ilya Kreymer 2024-10-07 13:05:23 -07:00 committed by GitHub
parent 406879f2f4
commit dde5056242
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<this> & Map<string, unknown>,
) {
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,
});