Skip to content

Commit

Permalink
fix: blank screen when navigating back from WS Switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Dec 12, 2024
1 parent 6b4078c commit a64553e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
10 changes: 2 additions & 8 deletions src/components/WorkspaceSwitcherButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@ type WorkspaceSwitcherButtonOnyxProps = {
policy: OnyxEntry<Policy>;
};

type WorkspaceSwitcherButtonProps = WorkspaceSwitcherButtonOnyxProps & {
/**
* Callback used to keep track of the workspace switching process in the BaseSidebarScreen.
*/
onSwitchWorkspace?: () => void;
};
type WorkspaceSwitcherButtonProps = WorkspaceSwitcherButtonOnyxProps;

function WorkspaceSwitcherButton({policy, onSwitchWorkspace}: WorkspaceSwitcherButtonProps) {
function WorkspaceSwitcherButton({policy}: WorkspaceSwitcherButtonProps) {
const {translate} = useLocalize();
const theme = useTheme();

Expand Down Expand Up @@ -54,7 +49,6 @@ function WorkspaceSwitcherButton({policy, onSwitchWorkspace}: WorkspaceSwitcherB
accessible
testID="WorkspaceSwitcherButton"
onPress={() => {
onSwitchWorkspace?.();
pressableRef?.current?.blur();
interceptAnonymousUser(() => {
Navigation.navigate(ROUTES.WORKSPACE_SWITCHER);
Expand Down
7 changes: 3 additions & 4 deletions src/pages/WorkspaceSwitcherPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ function WorkspaceSwitcherPage() {

setActiveWorkspaceID(newPolicyID);
if (newPolicyID !== activeWorkspaceID) {
Navigation.navigateWithSwitchPolicyID({policyID: newPolicyID});
InteractionManager.runAfterInteractions(() => {
Navigation.navigateWithSwitchPolicyID({policyID: newPolicyID});
});
}
InteractionManager.runAfterInteractions(() => {
Navigation.goBack();
});
},
[activeWorkspaceID, setActiveWorkspaceID, isFocused],
);
Expand Down

0 comments on commit a64553e

Please sign in to comment.