Templates: Fix "Discard changes?" dialog after creating template with master template (fixes #20262) (#20749)

Moves the _data.updateCurrent() call inside the updateLayoutBlock conditional
in setMasterTemplate(). This prevents spurious change detection when loading
templates from the server, while maintaining proper change tracking when users
actually modify the master template via the UI.

This completes the fix started in PR #20529 which added the updateLayoutBlock
parameter but inadvertently left the data model update outside the conditional.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jacob Overgaard
2025-11-10 12:00:43 +01:00
committed by GitHub
parent 73fd52aeea
commit 89989d60ce

View File

@@ -123,9 +123,8 @@ export class UmbTemplateWorkspaceContext
if (updateLayoutBlock) {
this.#updateMasterTemplateLayoutBlock();
}
this._data.updateCurrent({ masterTemplate: unique ? { unique } : null });
}
return unique;
}