be5249b67d8d74f021117dc9617a80c339dcfbfd
useLocalStorage's setValue captured 'state' at closure-definition time. When multiple updateConfig calls fired before a re-render (e.g. NostrSync and useInitialSync both calling updateConfig on startup), each call's functional updater received the same stale state snapshot instead of the accumulated result of previous calls — so later writes silently discarded earlier ones. Fixed by using React's built-in functional setState form (setState(prev => ...)) which always receives the true current state from React's queue, making all sequential updateConfig calls chain correctly regardless of render timing.
Description
Languages
TypeScript
95.7%
Java
1.5%
JavaScript
0.9%
Swift
0.9%
CSS
0.5%
Other
0.4%