Skip to content

feat: add unsaved changes confirmation to settings page (Closes #1086) - #1154

Open
sojetunde8 wants to merge 1 commit into
LabsCrypt:mainfrom
sojetunde8:fix/issue-1086-unsaved-changes-settings
Open

feat: add unsaved changes confirmation to settings page (Closes #1086)#1154
sojetunde8 wants to merge 1 commit into
LabsCrypt:mainfrom
sojetunde8:fix/issue-1086-unsaved-changes-settings

Conversation

@sojetunde8

Copy link
Copy Markdown

Closes #1086

Summary

  • Track dirty state by comparing initial vs current values for all editable settings fields
  • Add native beforeunload handler to warn on tab close, browser refresh, and back/forward navigation
  • Add window.confirm prompts for in-app navigation via the "Connect Wallet" button and "Disconnect Wallet" button when dirty
  • Replace the "Connect Wallet" <Link> with a <button> to intercept navigation with confirmation

Testing

  • Added 7 unit tests covering: clean start, dirty detection for each field (theme, currency, format, decimals), no-confirm when unchanged, and disconnect flow without changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] settings-content.tsx does not confirm before discarding unsaved changes on navigation

1 participant