Skip to content

Commit f7d7318

Browse files
designsatsclaude
andcommitted
fix(send): dismiss payment completed screen when app is backgrounded
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). Closes blinkbitcoin/blink-wip#554 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 69f0aa9 commit f7d7318

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/screens/send-bitcoin-screen/send-bitcoin-completed-screen.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,10 @@ const SendBitcoinCompletedScreen: React.FC<Props> = ({ route }) => {
353353
}
354354
}, [feedbackShownData?.data?.feedbackModalShown, requestFeedback])
355355

356-
const handleNavigateHome = useCallback(() => navigation.navigate("Primary"), [navigation])
356+
const handleNavigateHome = useCallback(
357+
() => navigation.navigate("Primary"),
358+
[navigation],
359+
)
357360

358361
const appState = useRef(AppState.currentState)
359362
useEffect(() => {

0 commit comments

Comments
 (0)