From bce562e73bf5739d9712e8a3feddee90962333bd Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Fri, 8 May 2026 12:33:08 -0400 Subject: [PATCH] fix: skip splash screen when cached rooms are available on resume When foregrounding after a period in the background, the app now shows the room list immediately using cached IndexedDB data instead of waiting for the first server sync response. The 'Connecting...' banner from SyncStatus remains visible during the reconnect. Fresh sessions with no cached rooms continue to wait for PREPARED/ SYNCING as before. --- src/app/pages/client/ClientRoot.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/pages/client/ClientRoot.tsx b/src/app/pages/client/ClientRoot.tsx index 70ba9221e..c0ad27195 100644 --- a/src/app/pages/client/ClientRoot.tsx +++ b/src/app/pages/client/ClientRoot.tsx @@ -288,6 +288,17 @@ export function ClientRoot({ children }: ClientRootProps) { } }, [mx]); + // Once the client has started (store loaded from IndexedDB, sync loop running), + // hide the splash immediately if there are cached rooms — no need to wait for + // the first server response. The SyncStatus banner shows "Connecting..." instead. + useEffect(() => { + if (startState.status !== AsyncStatus.Success || !mx) return; + if (isClientReady(mx.getSyncState())) return; + if (mx.getRooms().length > 0) { + setLoading(false); + } + }, [mx, startState.status]); + useSyncState( mx, useCallback((state: string) => {