Skip to content

Commit 4718bfb

Browse files
committed
fix: Go to workspace on invited workspace chat opens not here page
1 parent b8ef627 commit 4718bfb

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,24 @@ function adaptStateIfNecessary({state, options: {sidebarScreen, defaultCentralSc
9393
// @ts-expect-error Updating read only property
9494
// eslint-disable-next-line no-param-reassign
9595
state.stale = true;
96-
97-
// @ts-expect-error Updating read only property
98-
// Push the default settings central pane screen.
99-
state.routes.push({
100-
name: previousSelectedCentralScreen ?? defaultCentralScreen,
101-
params: state.routes.at(0)?.params,
102-
});
96+
const previousSelectedCentralScreenRoute = previousSameNavigatorState?.routes?.at(-1);
97+
const previousSelectedCentralScreenPolicyID = getRoutePolicyID(previousSelectedCentralScreenRoute as NavigationPartialRoute);
98+
99+
if (previousSelectedCentralScreenPolicyID === routePolicyID) {
100+
// @ts-expect-error Updating read only property
101+
// Push the default settings central pane screen.
102+
state.routes.push({
103+
name: previousSelectedCentralScreen ?? defaultCentralScreen,
104+
params: state.routes.at(0)?.params,
105+
});
106+
} else {
107+
// @ts-expect-error Updating read only property
108+
// Push the default settings central pane screen.
109+
state.routes.push({
110+
name: defaultCentralScreen,
111+
params: state.routes.at(0)?.params,
112+
});
113+
}
103114
}
104115
}
105116

0 commit comments

Comments
 (0)