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

Commit

Permalink
fix: restore interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Sep 10, 2018
1 parent bc2a509 commit 2969f1f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/model/element-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export class ElementAction {
project: Project;
event: Event;
}): void {
const storeAction = this.userStore.getActionById(this.storeActionId);
const userStore = project.getUserStore();
const storeAction = userStore.getActionById(this.storeActionId);

if (!storeAction) {
return;
Expand All @@ -102,14 +103,14 @@ export class ElementAction {
case Types.UserStoreActionType.Noop:
return;
case Types.UserStoreActionType.Set: {
const storeProperty = this.userStore.getPropertyById(this.storePropertyId);
const storeProperty = userStore.getPropertyById(this.storePropertyId);
if (storeProperty) {
storeProperty.setValue(this.getResolvedPayload({ project, event }) || '');
}
break;
}
case Types.UserStoreActionType.SetPage: {
const pageProperty = this.userStore.getPageProperty();
const pageProperty = userStore.getPageProperty();
pageProperty.setValue(this.getPayload());
break;
}
Expand Down
2 changes: 2 additions & 0 deletions src/model/user-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ export class UserStore {
referenceChanges.changed.forEach(change => change.before.update(change.after));
referenceChanges.removed.forEach(change => this.removeReference(change.before));

this.currentPageProperty.update(userStore.currentPageProperty);

if (opts && !opts.withEnhancer) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/preview/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function main(): void {
}
);

/* Mobx.autorun(
Mobx.autorun(
() => {
const userStore = store.getProject().getUserStore();

Expand All @@ -197,7 +197,7 @@ function main(): void {
{
scheduler: window.requestIdleCallback
}
); */
);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/renderer/create-project-message-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export function createProjectMessageHandler({
break;
}
case Message.MessageType.ChangeUserStore: {
project.startBatch();
project.getUserStore().sync(message, { withEnhancer: false });
project.endBatch();
break;
}
case Message.MessageType.SelectElement: {
Expand Down

0 comments on commit 2969f1f

Please sign in to comment.