diff options
Diffstat (limited to 'packages/main/src/infrastructure')
-rw-r--r-- | packages/main/src/infrastructure/electron/RendererBridge.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/main/src/infrastructure/electron/RendererBridge.ts b/packages/main/src/infrastructure/electron/RendererBridge.ts index 8633b9d..c26aa94 100644 --- a/packages/main/src/infrastructure/electron/RendererBridge.ts +++ b/packages/main/src/infrastructure/electron/RendererBridge.ts | |||
@@ -53,7 +53,11 @@ export default class RendererBridge { | |||
53 | this.disposeOnPatch = onPatch(store.shared, (patch) => { | 53 | this.disposeOnPatch = onPatch(store.shared, (patch) => { |
54 | if (patches === undefined) { | 54 | if (patches === undefined) { |
55 | // Update unprotected stores (outside an action) right away. | 55 | // Update unprotected stores (outside an action) right away. |
56 | listener([patch]); | 56 | try { |
57 | listener([patch]); | ||
58 | } finally { | ||
59 | this.snapshot = getSnapshot(store.shared); | ||
60 | } | ||
57 | } else { | 61 | } else { |
58 | patches.push(patch); | 62 | patches.push(patch); |
59 | } | 63 | } |
@@ -77,8 +81,6 @@ export default class RendererBridge { | |||
77 | abort(undefined); | 81 | abort(undefined); |
78 | return; | 82 | return; |
79 | } | 83 | } |
80 | // Make shure that the saved snapshot is consistent with the patches we're going to send. | ||
81 | this.snapshot = getSnapshot(store.shared); | ||
82 | topLevelCall = call; | 84 | topLevelCall = call; |
83 | patches = []; | 85 | patches = []; |
84 | try { | 86 | try { |
@@ -91,6 +93,7 @@ export default class RendererBridge { | |||
91 | } finally { | 93 | } finally { |
92 | topLevelCall = undefined; | 94 | topLevelCall = undefined; |
93 | patches = undefined; | 95 | patches = undefined; |
96 | this.snapshot = getSnapshot(store.shared); | ||
94 | } | 97 | } |
95 | } | 98 | } |
96 | }); | 99 | }); |