Fix wallet blank screen when tapping back after enabling wallet#90139
Fix wallet blank screen when tapping back after enabling wallet#90139MelvinBot wants to merge 4 commits into
Conversation
Use Navigation.goBack instead of Navigation.navigate in FeesAndTerms submit handler so the EnablePayments screen is removed from the navigation stack. Also add a safety net in EnablePayments to redirect to the Wallet page if the ACTIVATE step is reached. Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| useEffect(() => { | ||
| if (userWallet?.currentStep !== CONST.WALLET.STEP.ACTIVATE) { | ||
| return; | ||
| } | ||
|
|
||
| Navigation.goBack(ROUTES.SETTINGS_WALLET); | ||
| }, [userWallet?.currentStep]); | ||
|
|
There was a problem hiding this comment.
@MelvinBot I don't think we need this useEffect. Please remove this
Remove the useEffect that redirected to the Wallet page when currentStep was ACTIVATE, as it is unnecessary. Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
|
All code checks are passing (ESLint, Prettier, typecheck, all 8 test jobs, React Compiler Compliance, Storybook, perf-tests, builds, spellcheck, etc.). The only failing check is checklist (PR Author Checklist), which flags unchecked template boxes — not a code issue. This is expected for a draft PR and needs to be completed manually before marking the PR as ready for review. |
|
@MelvinBot please merge main |
…eenGoBack Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
|
Main has been merged into this PR branch. ✅ |
|
All CI checks have now completed. The only failing check is PR Author Checklist, which requires manual action (checking off items in the PR description) — it's not a code issue and cannot be auto-fixed. Every other check passed: Jest tests (all 8 jobs), TypeScript, ESLint, Prettier, React Compiler Compliance, Storybook, perf-tests, builds, and spellcheck. |
|
@MelvinBot Please add tests in the PR description that verify the implemented fix and complete all checkboxes in the PR Author Checklist |
|
Updated the PR description with test steps, QA steps, and completed the PR Author Checklist. Please add screenshots/videos for each platform before marking as ready for review. |
|
@MelvinBot Please mark the PR as ready for review. |
|
PR has been marked as ready for review. ✅ |
|
@nyomanjyotisa Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid-Native.mp4Android: mWeb ChromeAndroid-mWeb.Chrome.mp4iOS: HybridAppiOS-Native.mp4iOS: mWeb SafariiOS-mWeb.Safari.mp4MacOS: Chrome / SafariMacOS-Chrome.mp4 |
|
@MelvinBot please merge main |
…eenGoBack Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
|
Merged |
|
@nyomanjyotisa Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Explanation of Change
After completing the wallet activation flow (Fees & Terms),
FeesAndTerms.submit()calledNavigation.navigate(ROUTES.SETTINGS_WALLET)which pushed a new Wallet screen onto the stack while leaving theEnablePaymentsscreen behind it. When the user tapped the back button, they landed onEnablePaymentswithcurrentStep = ACTIVATE, which was unhandled in the switch statement, causing the component to returnnull— a blank screen.This PR changes
Navigation.navigatetoNavigation.goBackin theFeesAndTermssubmit handler so theEnablePaymentsscreen is properly removed from the navigation stack.Fixed Issues
$ #86633
PROPOSAL: #86633 (comment)
Tests
Offline tests
N/A — navigation-only change, no network dependency.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari