V16: Creating a new sub template should not show Discard Changes dialog (#20068)

fix: sets the masterTemplate at each opportunity to avoid Discard Changes dialog
This commit is contained in:
Jacob Overgaard
2025-09-03 16:09:35 +02:00
committed by GitHub
parent 06bbec433b
commit 59a34f6d49

View File

@@ -67,15 +67,16 @@ export class UmbTemplateWorkspaceContext
override async load(unique: string) {
const response = await super.load(unique);
if (response.data) {
this.setMasterTemplate(response.data.masterTemplate?.unique ?? null);
}
await this.setMasterTemplate(response.data?.masterTemplate?.unique ?? null);
return response;
}
async create(parent: UmbEntityModel) {
const data = await this.createScaffold({
parent,
preset: {
masterTemplate: parent.unique ? { unique: parent.unique } : null,
},
});
// Set or reset the master template