From 88d8ce05b88719937b212d049b1d27a8ad7fea34 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Fri, 27 Oct 2023 21:43:34 +0800 Subject: [PATCH] Possible fix to race conditions between queries in homepage which resulted in laggy rerenders of map --- src/routes/Home/Home.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/routes/Home/Home.tsx b/src/routes/Home/Home.tsx index 063b8b3..1cbcdc2 100644 --- a/src/routes/Home/Home.tsx +++ b/src/routes/Home/Home.tsx @@ -381,12 +381,14 @@ export default function Home() { ); } else if ( - (StudentStatusQuery.isFetching && studying) || - StudentStatusListQuery.isFetching || - StudyGroupQuery.isFetching || - (StudentStatusQuery.isFetching && !studying) || - StudentStatusListGlobalQuery.isFetching || - StudyGroupGlobalQuery.isFetching + (!StudentStatusQuery.isSuccess && + studying && + !StudentStatusListQuery.isSuccess && + !StudyGroupQuery.isSuccess && + !StudentStatusQuery.isSuccess) || + (!studying && + !StudentStatusListGlobalQuery.isSuccess && + !StudyGroupGlobalQuery.isSuccess) ) { return ( <>