Fix: WS switcher and LHN are not reset to Expensify after leaving#45285
Conversation
|
|
||
| function BottomTabNavigator() { | ||
| const activeRoute = useNavigationState<RootStackParamList, NavigationPartialRoute<CentralPaneName> | undefined>(getTopmostCentralPaneRoute); | ||
| const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY); |
There was a problem hiding this comment.
Subscribe only to the active workspace
There was a problem hiding this comment.
Wasn't this changed supposed to be on the SidebarScreen?
There was a problem hiding this comment.
Currently, the SidebarScreen is always mounted again once we leave the workspace then return to LHN. Because it is mounted again, so the logic:
!selectedPolicy && !prevSelectedPolicy
that used in my solution is always false because both of them are undefined when we leave the workspace then return to LHN.
There was a problem hiding this comment.
Move the logic back to the Sidebar and in the useEffect only check for the current selected policy
There was a problem hiding this comment.
@s77rt As I said above, we cannot move the logic to Sidebar. Can you help check again?
There was a problem hiding this comment.
Can you explain why we can't go with the suggested solution above?
There was a problem hiding this comment.
both of them are
undefined
You should check only the current selected policy
There was a problem hiding this comment.
Ah you mean we should !selectedPolicy instead of !selectedPolicy && !prevSelectedPolicy, right?
There was a problem hiding this comment.
Move the logic back to the Sidebar and in the useEffect only check for the current selected policy
|
Working on it now |
|
@s77rt I updated PR |
| Timing.start(CONST.TIMING.SIDEBAR_LOADED, true); | ||
| }, []); | ||
|
|
||
| const [selectedPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activeWorkspaceID ?? -1}`); |
There was a problem hiding this comment.
| const [selectedPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activeWorkspaceID ?? -1}`); | |
| const [activeWorkspace] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activeWorkspaceID ?? -1}`); |
NAB. Naming consistency
|
I updated PR |
|
@truph01 In testing step 7 can you please add "Verify" before the sentence for clarity |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemweb-chrome.moviOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
|
@s77rt I addressed all your comments. |
|
✋ 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/cristipaval in version: 9.0.15-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.0.15-9 🚀
|
Details
Fixed Issues
$ #43981
PROPOSAL: #43981 (comment)
Tests
Precondition:
User is invited to a workspace.
LHN will show all the chats because Expensify is selected.
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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
Screen.Recording.2024-07-11.at.22.52.34.mov
Android: mWeb Chrome
Screen.Recording.2024-07-11.at.23.11.28.mov
iOS: Native
Screen.Recording.2024-07-11.at.23.03.51.mov
iOS: mWeb Safari
Screen.Recording.2024-07-11.at.22.56.08.mov
MacOS: Chrome / Safari
Screen.Recording.2024-07-11.at.22.39.18.mov
MacOS: Desktop
Screen.Recording.2024-07-11.at.22.41.42.mov