Skip to content

Commit

Permalink
effector#149 Fix crash in try environment while use restore
Browse files Browse the repository at this point in the history
  • Loading branch information
Antropov Andrey committed Jul 15, 2019
1 parent fae4eb5 commit 3135769
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions website/editor/src/dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,14 @@ switcher({

realmInvoke.watch(({method, params, instance}) => {
if (method === 'restore') {
for (const key in instance) {
realmStore(instance[key])
if (params.length > 0
&& (params[0].kind === 'event' || params[0].kind === 'effect')
) {
realmStore(instance)
} else {
for (const key in instance) {
realmStore(instance[key])
}
}
}
if (method === 'createApi') {
Expand Down

0 comments on commit 3135769

Please sign in to comment.