Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Labels: bug, enhancement, frontend, Stellar Wave
Changing a setting on the Settings page doesn't update amounts that are already on screen, because every useSettings() call keeps its own private state.
In frontend/src/hooks/useSettings.ts:31-59, each caller does its own useState seeded from localStorage. The setters write to localStorage, but they only update the instance that called them. There's no Context and no storage event listener, so when you change decimalPlaces or amountFormat, other mounted components (and other tabs) keep showing the old formatting until they remount.
What the fix has to hold to
- One shared source of truth (Context or an external store) so every consumer re-renders when a setting changes
- A
window storage listener so settings stay in sync across tabs
Done when
Where to start
All in useSettings.ts. The Settings page's missing-dependency useEffect is a separate thing, leave it alone here.
Labels:
bug,enhancement,frontend,Stellar WaveChanging a setting on the Settings page doesn't update amounts that are already on screen, because every
useSettings()call keeps its own private state.In
frontend/src/hooks/useSettings.ts:31-59, each caller does its ownuseStateseeded from localStorage. The setters write to localStorage, but they only update the instance that called them. There's no Context and nostorageevent listener, so when you changedecimalPlacesoramountFormat, other mounted components (and other tabs) keep showing the old formatting until they remount.What the fix has to hold to
windowstoragelistener so settings stay in sync across tabsDone when
useSettingsbacked by a shared store, all consumers update on changedecimalPlaceswithout remountingWhere to start
All in
useSettings.ts. The Settings page's missing-dependency useEffect is a separate thing, leave it alone here.