feat: avoid display any dashboard before boot complete loading.

This commit is contained in:
a.bouhuolia
2021-11-27 17:53:54 +02:00
parent 3db00f6f70
commit 8b28d6894f
2 changed files with 8 additions and 7 deletions

View File

@@ -16,8 +16,9 @@ export function useDashboardMetaBoot() {
data: dashboardMeta, data: dashboardMeta,
isLoading: isDashboardMetaLoading, isLoading: isDashboardMetaLoading,
isSuccess: isDashboardMetaSuccess, isSuccess: isDashboardMetaSuccess,
} = useDashboardMeta(); } = useDashboardMeta({
keepPreviousData: true,
});
const [startLoading, stopLoading] = useSplashLoading(); const [startLoading, stopLoading] = useSplashLoading();
useWatchImmediate((value) => { useWatchImmediate((value) => {

View File

@@ -8,9 +8,9 @@ import { useDashboardBoot } from './DashboardBoot';
export default function DashboardProvider({ children }) { export default function DashboardProvider({ children }) {
const { isLoading } = useDashboardBoot(); const { isLoading } = useDashboardBoot();
return ( // Avoid display any dashboard component before complete booting.
<DashboardAbilityProvider> if (isLoading) {
{isLoading ? null : children} return null;
</DashboardAbilityProvider> }
); return <DashboardAbilityProvider>{children}</DashboardAbilityProvider>;
} }