diff --git a/web/context/global-public-context.tsx b/web/context/global-public-context.tsx index 17a7441642..71a2e37d07 100644 --- a/web/context/global-public-context.tsx +++ b/web/context/global-public-context.tsx @@ -6,6 +6,7 @@ import { useEffect } from 'react' import type { SystemFeatures } from '@/types/feature' import { defaultSystemFeatures } from '@/types/feature' import { getSystemFeatures } from '@/service/common' +import Loading from '@/app/components/base/loading' type GlobalPublicStore = { systemFeatures: SystemFeatures @@ -20,7 +21,7 @@ export const useGlobalPublicStore = create(set => ({ const GlobalPublicStoreProvider: FC = ({ children, }) => { - const { data } = useQuery({ + const { isPending, data } = useQuery({ queryKey: ['systemFeatures'], queryFn: getSystemFeatures, }) @@ -29,6 +30,8 @@ const GlobalPublicStoreProvider: FC = ({ if (data) setSystemFeatures({ ...defaultSystemFeatures, ...data }) }, [data, setSystemFeatures]) + if (isPending) + return
return <>{children} } export default GlobalPublicStoreProvider