Skip to content

Commit

Permalink
fix(storage): fix signal storage issue
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed May 1, 2024
1 parent 040a433 commit 50e9718
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/reactant-storage/src/storage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ class ReactantStorage extends PluginModule {
stopWatching();
const persistStateKeys = persistConfig.whitelist ?? [];
persistStateKeys.forEach((persistStateKey) => {
// need to update the target signal value to the latest hydrated state
target[signalMapKey][persistStateKey].value =
ref.state![persistStateKey];
if (target[signalMapKey]?.[persistStateKey]) {
// need to update the target signal value to the latest hydrated state
target[signalMapKey][persistStateKey].value =
ref.state![persistStateKey];
}
});
}
}
Expand Down

0 comments on commit 50e9718

Please sign in to comment.