Fix useActiveWorkspaceFromNavigationState#53576
Conversation
|
@ZhenjaHorbach 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: Nativeandroid.movAndroid: mWeb Chromeandroid-web.moviOS: Nativeios.moviOS: mWeb Safariios-web.movMacOS: Chrome / Safariweb.movMacOS: DesktopNA |
| } | ||
|
|
||
| const params = state.routes.at(-1)?.params ?? {}; | ||
| const lastHomeParams = state.routes.findLast((route) => route.name === SCREENS.HOME)?.params ?? {}; |
There was a problem hiding this comment.
I'm wondering if this will break the deep links?
If we open the app ignoring home screen
Maybe we should update code like:
state.routes.findLast((route) => route.name === SCREENS.HOME)?.params ?? state.routes.at(-1)?.params ?? {};
There was a problem hiding this comment.
Hi! That's a good question. Could you please be a little more specific about the case when it could break? I am not sure if I understand it correctly. Thanks! 🙇
There was a problem hiding this comment.
I'm not sure this is a problem 😅
But let's say we open a screen which is not related to Home using a deep link when the app is closed
In theory, we shouldn't have params from Home screen in that case
So in that case I would use params from the last screen using state.routes.at(-1)
There was a problem hiding this comment.
I think in that case we should get undefined right? The bottom tab settings screen doesn't have the workspace switcher anymore. And search has a different way of keeping policyID (inside the search query)
There was a problem hiding this comment.
Hmm
Yeah
That makes sense
Thanks for the explanation !
|
LGTM ! |
|
bump @mountiny |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.73-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.73-8 🚀
|
Explanation of Change
The
useActiveWorkspaceFromNavigationStatecould returnundefinedeven when thepolicyIDwas defined. It should work well now.One of the effects of broken
useActiveWorkspaceFromNavigationStatewas a problem with going back after series of specific navigation actions.Fixed Issues
$ #53377
PROPOSAL:
Tests
Offline tests
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))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.mp4
Android: mWeb Chrome
androidWeb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
iosWeb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop