Skip to content

Commit

Permalink
Merge pull request #46930 from Expensify/jack-preventOpenWorkspacewith-1
Browse files Browse the repository at this point in the history
Prevent calling OpenWorkspace with an empty policyID
  • Loading branch information
srikarparsi authored Aug 7, 2024
2 parents 8c11aa4 + b3451be commit de89479
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pages/home/sidebar/SidebarLinksData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ function SidebarLinksData({insets, isLoadingApp = true, onLinkClick, priorityMod

const {orderedReportIDs, currentReportID, policyMemberAccountIDs} = useReportIDs();

// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
useEffect(() => Policy.openWorkspace(activeWorkspaceID ?? '-1', policyMemberAccountIDs), [activeWorkspaceID]);
useEffect(() => {
if (!activeWorkspaceID) {
return;
}

Policy.openWorkspace(activeWorkspaceID, policyMemberAccountIDs);
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [activeWorkspaceID]);

const isLoading = isLoadingApp;
const currentReportIDRef = useRef(currentReportID);
Expand Down

0 comments on commit de89479

Please sign in to comment.