From 798c1a5e6b10e34fd1b3901acece432416bc3fe3 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 1 Oct 2023 15:57:45 +0800 Subject: [PATCH] Added potential fix to homepage map elements sometimes not rendering on startup --- src/routes/Home/Home.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/Home/Home.tsx b/src/routes/Home/Home.tsx index 8e3cbd7..ecdbfab 100644 --- a/src/routes/Home/Home.tsx +++ b/src/routes/Home/Home.tsx @@ -228,7 +228,7 @@ export default function Home() { useState([]); // Student Status List const StudentStatusListQuery = useQuery({ - enabled: studying, + enabled: studying && !StudentStatusQuery.isLoading, queryKey: ["user_status_list"], queryFn: async () => { const data = await GetStudentStatusListNear(); @@ -260,7 +260,7 @@ export default function Home() { useState([]); // Student Status List Global const StudentStatusListGlobalQuery = useQuery({ - enabled: !studying, + enabled: !studying && !StudentStatusQuery.isLoading, queryKey: ["user_status_list_global"], queryFn: async () => { const data = await GetStudentStatusList(); @@ -291,7 +291,7 @@ export default function Home() { const [study_groups, setStudyGroups] = useState([]); // Study Group List const StudyGroupQuery = useQuery({ - enabled: studying, + enabled: studying && !StudentStatusQuery.isLoading, queryKey: ["study_group_list"], queryFn: async () => { const data = await GetStudyGroupListFiltered(); @@ -319,7 +319,7 @@ export default function Home() { >([]); // Study Group Global List const StudyGroupGlobalQuery = useQuery({ - enabled: !studying, + enabled: !studying && !StudentStatusQuery.isLoading, queryKey: ["study_group_list_global"], queryFn: async () => { const data = await GetStudyGroupList();