Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat: keep around the last valid designtime store
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Sep 10, 2018
1 parent f4257c9 commit 06fb394
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/model/user-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface UserStoreContext {

export class UserStore {
private id: string;
private previousDesignTimeStore: DesignTime.DesignTimeUserStore;

@Mobx.observable private actions: Map<string, UserStoreAction> = new Map();
@Mobx.observable private currentPageProperty: UserStoreProperty;
@Mobx.observable private enhancer: UserStoreEnhancer;
Expand All @@ -35,14 +37,17 @@ export class UserStore {
private get designTimeStore(): DesignTime.DesignTimeUserStore | undefined {
try {
const enhanceModule = this.enhancer.getModule();
return enhanceModule.onStoreCreate(

this.previousDesignTimeStore = enhanceModule.onStoreCreate(
new DesignTime.DesignTimeUserStore({
properties: [...this.internalProperties.values()]
})
);

return this.previousDesignTimeStore;
} catch (error) {
console.error(error);
return;
return this.previousDesignTimeStore;
}
}

Expand Down

0 comments on commit 06fb394

Please sign in to comment.