feat: apply delayed loading to app boot skeleton
This commit is contained in:
@@ -28,6 +28,7 @@ import { ToastContainer } from '../ui/ToastContainer';
|
|||||||
import { UpdateToast } from '../ui/UpdateToast';
|
import { UpdateToast } from '../ui/UpdateToast';
|
||||||
import { ContextMenuRenderer } from '../ui/ContextMenuRenderer';
|
import { ContextMenuRenderer } from '../ui/ContextMenuRenderer';
|
||||||
import { useAuth } from '../../hooks/useAuth';
|
import { useAuth } from '../../hooks/useAuth';
|
||||||
|
import { useDelayedLoading } from '../../hooks/useDelayedLoading';
|
||||||
import { useWebSocket } from '../../hooks/useWebSocket';
|
import { useWebSocket } from '../../hooks/useWebSocket';
|
||||||
import { useFederationToasts } from '../../hooks/useFederationToasts';
|
import { useFederationToasts } from '../../hooks/useFederationToasts';
|
||||||
import { useLiveKit } from '../../hooks/useLiveKit';
|
import { useLiveKit } from '../../hooks/useLiveKit';
|
||||||
@@ -91,6 +92,7 @@ export function AppLayout() {
|
|||||||
}, [outputDeviceId]);
|
}, [outputDeviceId]);
|
||||||
|
|
||||||
const { user, isLoading } = useAuth();
|
const { user, isLoading } = useAuth();
|
||||||
|
const showBootSkeleton = useDelayedLoading(isLoading);
|
||||||
const setCurrentSpace = useSpaceStore((s) => s.setCurrentSpace);
|
const setCurrentSpace = useSpaceStore((s) => s.setCurrentSpace);
|
||||||
const loadSpaceDetail = useSpaceStore((s) => s.loadSpaceDetail);
|
const loadSpaceDetail = useSpaceStore((s) => s.loadSpaceDetail);
|
||||||
const setCurrentChannel = useChatStore((s) => s.setCurrentChannel);
|
const setCurrentChannel = useChatStore((s) => s.setCurrentChannel);
|
||||||
@@ -262,7 +264,7 @@ export function AppLayout() {
|
|||||||
}
|
}
|
||||||
}, [spaceId, channelId, channels, navigate]);
|
}, [spaceId, channelId, channels, navigate]);
|
||||||
|
|
||||||
if (isLoading || !user) {
|
if (!user || showBootSkeleton) {
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex bg-surface-base" role="status" aria-label="Loading Backspace">
|
<div className="h-full flex bg-surface-base" role="status" aria-label="Loading Backspace">
|
||||||
{/* Space strip */}
|
{/* Space strip */}
|
||||||
|
|||||||
Reference in New Issue
Block a user