fix(send): dismiss payment completed screen when app is backgrounded#3712
Open
designsats wants to merge 1 commit into
Open
fix(send): dismiss payment completed screen when app is backgrounded#3712designsats wants to merge 1 commit into
designsats wants to merge 1 commit into
Conversation
ad054f4 to
f7d7318
Compare
Contributor
Author
|
Got this response from Claude to failing checks @grimen @blink-claw-bot The options are: Include generated.ts in this PR — it's technically a separate concern but it unblocks the check Open a separate PR first that syncs generated.ts on main, then rebase ours on top of it Leave it — the upstream maintainers may notice and fix main themselves, then our PR would pass on rebase" |
Contributor
Author
|
@grimen review required |
grimen
requested changes
Mar 16, 2026
grimen
left a comment
Contributor
There was a problem hiding this comment.
Add test coverage to cover the change.
The SendBitcoinCompletedScreen had no awareness of app lifecycle events, so it would persist indefinitely if the user paid in-store, left the app, and returned later — showing a stale confirmation screen. Added an AppState listener that tracks the active → background transition and navigates home when the app is backgrounded. Follows the same pattern as AppStateWrapper (useRef for previous state, explicit transition check). Added tests covering the active → background dismiss and that other transitions (e.g. active → inactive) do not navigate home. Closes blinkbitcoin/blink-wip#554 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
f7d7318 to
cd1bccf
Compare
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.
Problem
When a user pays in-store and then leaves the app, the
SendBitcoinCompletedScreenpersists indefinitely. Returning to the app later shows a stale confirmation screen with no way to know it's from a previous session.Closes https://github.com/blinkbitcoin/blink-wip/issues/554
Solution
Added an
AppStatelistener insideSendBitcoinCompletedScreenthat navigates the user home whenever the app transitions to the background. The screen is dismissed automatically — so when the user returns, they land on the home screen rather than a stale payment receipt.Implementation
send-bitcoin-completed-screen.tsx: the listener changeAppStateWrapperinapp/navigation/app-state.tsx: auseReftracks the previous app state so only the explicitactive → backgroundtransition triggers the dismiss (not spurious events)handleNavigateHomeis wrapped inuseCallbackto keep the effect dependency stableTests
Added automated coverage in
__tests__/screens/send-bitcoin-completed-screen.spec.tsx:navigate("Primary")) on theactive → backgroundtransitionactive → inactive,inactive → background), guarding against spurious eventsManual test plan
🤖 Generated with Claude Code