fix load response

This commit is contained in:
Mads Rasmussen
2024-09-24 14:39:31 +02:00
parent 737aea0239
commit ca9d0bbefb
2 changed files with 9 additions and 7 deletions

View File

@@ -112,12 +112,12 @@ export class UmbDataTypeWorkspaceContext
]);
}
async load(unique: string) {
const { asObservable } = await super.load(unique);
override async load(unique: string) {
const response = await super.load(unique);
if (asObservable) {
this.observe(asObservable(), (entity) => this.#onStoreChange(entity), 'umbDataTypeStoreObserver');
}
this.observe(response.asObservable?.(), (entity) => this.#onStoreChange(entity), 'umbDataTypeStoreObserver');
return response;
}
#onStoreChange(entity: EntityType | undefined) {

View File

@@ -53,9 +53,9 @@ export class UmbUserWorkspaceContext
}
override async load(unique: string) {
const { asObservable } = await super.load(unique);
const response = await super.load(unique);
this.observe(asObservable(), (user) => this.onUserStoreChanges(user), 'umbUserStoreObserver');
this.observe(response.asObservable?.(), (user) => this.onUserStoreChanges(user), 'umbUserStoreObserver');
if (!this._detailRepository) {
throw new Error('Detail repository is missing');
@@ -64,6 +64,8 @@ export class UmbUserWorkspaceContext
// Get the calculated start nodes
const { data: calculatedStartNodes } = await this._detailRepository.requestCalculateStartNodes(unique);
this.#calculatedStartNodes.setValue(calculatedStartNodes);
return response;
}
/* TODO: some properties are allowed to update without saving.