2
0
Эх сурвалжийг харах

improve a conditional branch

WNomunomu 2 жил өмнө
parent
commit
ad56174f85

+ 1 - 1
apps/app/src/stores/context.tsx

@@ -232,7 +232,7 @@ export const useIsReadOnlyUser = (): SWRResponse<boolean, Error> => {
 export const useIsAdmin = (): SWRResponse<boolean, Error> => {
   const { data: currentUser, isLoading } = useCurrentUser();
 
-  const isAdminUser = currentUser?.admin !== undefined ? currentUser.admin : false;
+  const isAdminUser = currentUser != null ? currentUser.admin : false;
 
   return useSWRImmutable(
     isLoading ? null : ['isAdminUser', currentUser?._id],