Skip to content

[Frontend] useSettings holds per-instance state with no shared store or storage listener - settings changes don't propagate across components/tabs #854

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

frontend/src/hooks/useSettings.ts:31-59 - each useSettings() call owns its own useState seeded from localStorage; the setters write localStorage but only update that one instance. There is no React context and no storage event listener, so changing decimalPlaces/amountFormat on the Settings page does not update amounts already rendered by other mounted components (or other tabs) until remount.

Acceptance criteria

  • Back useSettings with a shared source of truth (Context/external store) so all consumers re-render on change
  • Add a window storage event listener to sync settings across tabs
  • Add tests asserting two consumers reflect an updated decimalPlaces without remount

Files to touch

  • frontend/src/hooks/useSettings.ts

Out of scope

  • Settings page useEffect missing dependency

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingenhancementNew feature or requestfrontendFrontend related tasks

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions