After a homeserver stall Element Call showed "Connection lost" while the call bar still looked joined. Handle the fork's io.lotus.call_error: show "Call disconnected" with a Reconnect button (io.lotus.reconnect), and reconnect automatically once sync is back. Fixes #318 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
15 lines
662 B
TypeScript
15 lines
662 B
TypeScript
/**
|
|
* [Gitea #318] The fork's `io.lotus.call_error`: its error page is showing
|
|
* (`{ code, recoverable }`) or was cleared (`{ code: null }`).
|
|
*/
|
|
export type CallErrorState = { code: string; recoverable: boolean } | null;
|
|
|
|
/** Pure: parse a report; undefined for garbage (ignored). */
|
|
export function parseCallError(data: unknown): CallErrorState | undefined {
|
|
if (typeof data !== 'object' || data === null) return undefined;
|
|
const { code, recoverable } = data as { code?: unknown; recoverable?: unknown };
|
|
if (code === null) return null;
|
|
if (typeof code !== 'string' || !code) return undefined;
|
|
return { code, recoverable: recoverable === true };
|
|
}
|