Skip to content

Commit

Permalink
fix useActiveWorkspaceFromNavigationState
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgrzybowski committed Dec 4, 2024
1 parent 7d15aac commit 466b285
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 466b285

Please sign in to comment.