-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: preserve navigation state when opening settings from Onfido permission flow #80741
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
base: main
Are you sure you want to change the base?
fix: preserve navigation state when opening settings from Onfido permission flow #80741
Conversation
|
@bernhardoj 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| // Save the current route so the user can return to the verification flow | ||
| // after granting permissions in settings. On iOS, the app restarts when | ||
| // certain permissions are changed, so we need to preserve the navigation state. | ||
| saveLastRoute(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to say this, but let's use goToSettings function instead.
https://github.com/Expensify/App/blob/main/src/libs/goToSettings/index.native.tsx
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppios.mp4iOS: mWeb SafariMacOS: Chrome / Safari |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment left, gonna approve so it can be merged when I'm inactive
On iOS, when the user navigates to Settings to grant camera permissions, the app may restart when permissions are changed. This causes the user to lose their place in the verification flow. By calling saveLastRoute() before opening settings, we preserve the navigation state so the user returns to the verification screen after granting permissions.
33edeaf to
80b062e
Compare
|
@bernhardoj fixed |
|
@amyevans ready to merge |
Explanation of Change
On iOS, when a user denies camera permission during Onfido identity verification and then taps "Settings" to grant it, the app restarts when the permission is changed. This causes the user to exit the verification flow and land on the home screen.
This PR adds a call to
saveLastRoute()before opening settings, which preserves the navigation state. When the app restarts after the permission change, the user is returned to the verification screen instead of losing their progress.Fixed Issues
$ #79661
PROPOSAL: #79661 (comment)
Tests
Offline tests
N/A - This change only affects the navigation state preservation when opening iOS Settings. The offline behavior is unchanged.
QA Steps
Same as Tests - this must be tested on a physical iOS device as the app restart behavior only occurs on real devices.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
N/A - This is an iOS-specific issue. The app restart behavior when changing permissions only occurs on iOS.
Android: mWeb Chrome
N/A - Native only change (
index.native.tsx)iOS: Native
79661-ios-native.mp4
iOS: mWeb Safari
N/A - Native only change (
index.native.tsx)MacOS: Chrome / Safari
N/A - Native only change (
index.native.tsx)