(null)
const [rightPanel, setRightPanel] = useReducer(rpReducer, null)
const client = use(ClientContext)!
+ const syncStatus = useEventAsState(client.syncStatus)
const context = useMemo(
() => new ContextFields(setRightPanel, directSetActiveRoom, client),
[client],
@@ -144,9 +149,24 @@ const MainScreen = () => {
if (rightPanel) {
classNames.push("right-panel-open")
}
+ let syncLoader: JSX.Element | null = null
+ if (syncStatus.type === "waiting") {
+ syncLoader =
+
+ Waiting for first sync...
+
+ } else if (
+ syncStatus.type === "errored"
+ && (syncStatus.error_count > 2 || (syncStatus.last_sync ?? 0) + SYNC_ERROR_HIDE_DELAY < Date.now())
+ ) {
+ syncLoader =
+
+ Sync is failing
+
+ }
return
-
+
{resizeHandle1}
@@ -162,6 +182,7 @@ const MainScreen = () => {
{rightPanel && }
>}
+ {syncLoader}
}