fix(client): show load failures that are not Error objects

This commit is contained in:
Erwan Leboucher committed 2026-08-28 20:40:26 +02:00
1 parent 10c538c913
commit da3ad5ba2f
1 file changed
+5 -2
+5 -2
View File
@@ -60,6 +60,9 @@ const log = createLogger('ClientRoot');
const SESSION_SWITCH_KEY = 'sable-session-switch';
const errorMessage = (error: unknown): string =>
error instanceof Error ? error.message : String(error);
const isClientReady = (syncState: string | null): boolean =>
syncState === 'PREPARED' || syncState === 'SYNCING' || syncState === 'CATCHUP';
@@ -509,10 +512,10 @@ export function ClientRoot({ children }: ClientRootProps) {
</Button>
</>
) : (
<Text>{`Failed to load. ${loadState.error.message}`}</Text>
<Text>{`Failed to load. ${errorMessage(loadState.error)}`}</Text>
))}
{startState.status === AsyncStatus.Error && (
<Text>{`Failed to start. ${startState.error.message}`}</Text>
<Text>{`Failed to start. ${errorMessage(startState.error)}`}</Text>
)}
{!legacyCryptoUpgradeRequired && (
<Button variant="Critical" onClick={mx ? () => startMatrix(mx) : loadMatrix}>