WNomunomu 2 лет назад
Родитель
Сommit
8931d13805
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      apps/app/src/stores/context.tsx

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

@@ -237,7 +237,10 @@ export const useIsAdmin = (): SWRResponse<boolean, Error> => {
   return useSWRImmutable(
   return useSWRImmutable(
     isLoading ? null : ['isAdminUser', currentUser?._id],
     isLoading ? null : ['isAdminUser', currentUser?._id],
     () => isAdminUser,
     () => isAdminUser,
-    { fallbackData: isAdminUser },
+    {
+      fallbackData: isAdminUser,
+      keepPreviousData: true,
+    },
   );
   );
 };
 };