Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 7ae0fe4

Browse files
Prevent issue where launching app without being logged in would throw error
1 parent 0a8d93c commit 7ae0fe4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pages/Search/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export default function SearchPage() {
2828
const [loadingOrgs, setLoadingOrgs] = React.useState(true);
2929

3030
React.useEffect(() => {
31+
if (isLoading || !isAuthenticated) {
32+
return;
33+
}
34+
3135
(async () => {
3236
const organizations = await OrgService.getOrg(
3337
apiClient,
@@ -50,7 +54,7 @@ export default function SearchPage() {
5054
}
5155
})();
5256
// eslint-disable-next-line react-hooks/exhaustive-deps
53-
}, []);
57+
}, [isLoading, isAuthenticated]);
5458

5559
React.useEffect(() => {
5660
// Ensure that we are in the Global Search tab

0 commit comments

Comments
 (0)