-
Notifications
You must be signed in to change notification settings - Fork 4k
fix: Show discard changes modal on browser/device back in money-request flows #95076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MonilBhavsar
merged 26 commits into
Expensify:main
from
TaduJR:fix-Discard-changes-modal-doesnt-show-up-when-going-back-with-the-browser-back-button
Jul 13, 2026
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e4ab982
fix: use the committed baseline for money-request discard detection
TaduJR d39bf4e
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR d694324
fix: treat a typed zero as unsaved input on money-request create steps
TaduJR 3f44c54
fix: show the discard modal when editing waypoints on a distance expense
TaduJR db81b47
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR cda12bd
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR 30ed3c5
fix: default native tab backBehavior to 'none' so back leaves tabbed …
TaduJR 63890c9
refactor: simplify discard-confirmation internals and money-request p…
TaduJR 8e245f0
fix: let the confirmed discard replay bypass the history-restore swallow
TaduJR 91abe19
fix: don't prompt discard on a clean distance edit when the waypoint …
TaduJR 220acc5
fix: suppress the discard prompt on distance edit-save navigation
TaduJR 38c5cea
fix: flag manual distance edits in the distance discard check
TaduJR 4120f35
fix: treat a cleared manual distance as a discard-worthy edit
TaduJR e1641ce
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR 2c2beea
refactor: make IOURequestStepDistanceMap honestly create-only
TaduJR 6be4c83
test: use a cspell-clean waypoint address in MoneyRequestUtilsTest
TaduJR 06a5ebe
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR dac0873
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR 9eaa346
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR b2a562c
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR ed77427
refactor: use the create-presence check directly in the create-only d…
TaduJR bdfa728
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR 5a0e627
fix: flag a cleared amount field as dirty when the create draft alrea…
TaduJR f91d155
fix: flag cleared create fields as dirty when the draft already holds…
TaduJR a4d5bf0
Merge branch 'main' of https://github.com/TaduJR/App into fix-Discard…
TaduJR 205a172
style: make the money-request predicate JSDocs multiline
TaduJR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
17 changes: 17 additions & 0 deletions
17
src/hooks/useDiscardChangesConfirmation/runDiscardConfirmation.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import Log from '@libs/Log'; | ||
|
|
||
| /** | ||
| * Await `onConfirm`, then replay the blocked navigation — but if `onConfirm` rejects, log and run `onError` WITHOUT | ||
| * navigating, so a failed discard leaves the user in place rather than proceeding silently. | ||
| */ | ||
| function runDiscardConfirmation(onConfirm: (() => void | Promise<void>) | undefined, navigate: () => void, onError: () => void): void { | ||
| Promise.resolve() | ||
| .then(() => onConfirm?.()) | ||
| .then(navigate) | ||
| .catch((error: unknown) => { | ||
| Log.warn('[useDiscardChangesConfirmation] Failed to run onConfirm callback', {error}); | ||
| onError(); | ||
| }); | ||
| } | ||
|
|
||
| export default runDiscardConfirmation; |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.