add isNew to template workspace

This commit is contained in:
Mads Rasmussen
2023-02-16 14:14:09 +01:00
parent bb747709be
commit a4f6eccac4

View File

@@ -13,6 +13,8 @@ export class UmbTemplateWorkspaceContext {
name = createObservablePart(this.#data, (data) => data?.name);
content = createObservablePart(this.#data, (data) => data?.content);
isNew = false;
constructor(host: UmbControllerHostInterface) {
this.#host = host;
this.#templateDetailRepo = new UmbTemplateDetailRepository(this.#host);
@@ -39,6 +41,7 @@ export class UmbTemplateWorkspaceContext {
}
async createScaffold(parentKey: string | null) {
this.isNew = true;
const { data } = await this.#templateDetailRepo.createScaffold(parentKey);
if (!data) return;
this.#data.next(data);