Skip to content

Commit e1d4f31

Browse files
iOvergaardclaude
andcommitted
Templates: Fix "Discard changes?" dialog after creating template with master template (fixes #20262)
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 <[email protected]>
1 parent 3ab12e9 commit e1d4f31

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@ export class UmbTemplateWorkspaceContext
123123

124124
if (updateLayoutBlock) {
125125
this.#updateMasterTemplateLayoutBlock();
126+
this._data.updateCurrent({ masterTemplate: unique ? { unique } : null });
126127
}
127128

128-
this._data.updateCurrent({ masterTemplate: unique ? { unique } : null });
129-
130129
return unique;
131130
}
132131

0 commit comments

Comments
 (0)