mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
feat: avoid display any dashboard before boot complete loading.
This commit is contained in:
@@ -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) => {
|
||||||
|
|||||||
@@ -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>;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user