Skip to content

Commit

Permalink
Merge pull request #53576 from software-mansion-labs/adamgrzybowski/f…
Browse files Browse the repository at this point in the history
…ix-useActiveWorkspaceFromNavigationState

Fix useActiveWorkspaceFromNavigationState
  • Loading branch information
mountiny authored Dec 6, 2024
2 parents f7d076a + 466b285 commit 96f7fdd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hooks/useActiveWorkspaceFromNavigationState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ function useActiveWorkspaceFromNavigationState() {
Log.warn('useActiveWorkspaceFromNavigationState should be called only from BottomTab screens');
}

const params = state.routes.at(-1)?.params ?? {};
const lastHomeParams = state.routes.findLast((route) => route.name === SCREENS.HOME)?.params ?? {};

if ('policyID' in params) {
return params?.policyID;
if ('policyID' in lastHomeParams) {
return lastHomeParams.policyID;
}
});

Expand Down

0 comments on commit 96f7fdd

Please sign in to comment.