feat: add unsaved changes confirmation to settings page (Closes #1086) - #1154
Merged
K1NGD4VID merged 9 commits intoSep 1, 2026
Merged
Conversation
ogazboiz
requested changes
Aug 3, 2026
ogazboiz
left a comment
Contributor
There was a problem hiding this comment.
good instinct on #1086 and the test coverage is appreciated, but two design problems block this:
- settings on main persist immediately (toggleTheme writes localStorage on click), yet isDirty stays true forever after any change, so users get warned about "unsaved" changes that are already saved. either introduce a real draft-plus-save model or reset initialValuesRef after each apply.
- the guard only wraps the two in-page buttons. all navbar links and any other internal Link navigation bypass it entirely, so the stated goal is not met. cover app-internal navigation or scope the issue down explicitly.
- small ones: the Link to button swap loses link semantics, and there is a stray blank-line diff where handleDisconnect was touched.
if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0
Contributor
Author
Rsolved, @ogazboiz |
…anges feature - Remove duplicate `copied` state declaration in SettingsContent - Add missing `handleSave` function that persists draft settings and resets dirty state - Add missing `useUnsavedChangesGuard` import - Mock `DisconnectConfirmModal` in tests so disconnect flow assertions work Closes LabsCrypt#1086
…in stream details - Correct eslint-disable-next-line rule name from react-compiler/react-compiler to react-hooks/preserve-manual-memoization to suppress React Compiler memoization warning on liveClaimable useMemo - Fix stream-details-content test using getAllByText instead of getByText since the claimable amount appears twice (visible + screen-reader text)
TypeScript build fails with TS6133 when strictUnusedLocals is enabled. The React import was not needed since the component uses JSX transform.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1086
Summary
beforeunloadhandler to warn on tab close, browser refresh, and back/forward navigationwindow.confirmprompts for in-app navigation via the "Connect Wallet" button and "Disconnect Wallet" button when dirty<Link>with a<button>to intercept navigation with confirmationTesting