Cull a bunch of unused functions

This commit is contained in:
Jack Kingsman
2026-03-12 18:12:27 -07:00
parent 74c13d194c
commit 358589bd66
10 changed files with 22 additions and 990 deletions
+4 -9
View File
@@ -21,6 +21,7 @@ async function fetchJson<T>(path: string, init?: RequestInit): Promise<T> {
export interface HealthStatus {
radio_connected: boolean;
radio_initializing: boolean;
connection_info: string | null;
}
@@ -267,7 +268,7 @@ export async function ensureFlightlessChannel(): Promise<Channel> {
}
/**
* Wait for health to show radio_connected, polling with retries.
* Wait for health to show a fully ready radio, polling with retries.
*/
export async function waitForRadioConnected(
timeoutMs: number = 30_000,
@@ -277,19 +278,13 @@ export async function waitForRadioConnected(
while (Date.now() < deadline) {
try {
const health = await getHealth();
if (health.radio_connected) return;
if (health.radio_connected && !health.radio_initializing) return;
} catch {
// Backend might be restarting
}
await new Promise((r) => setTimeout(r, intervalMs));
}
throw new Error(`Radio did not reconnect within ${timeoutMs}ms`);
}
// --- Contacts sync ---
export function syncContacts(): Promise<{ synced: number }> {
return fetchJson('/contacts/sync', { method: 'POST' });
throw new Error(`Radio did not finish reconnect/setup within ${timeoutMs}ms`);
}
// --- Packets / Historical decryption ---