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

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