feat(app): daemon status with Stop/Restart in settings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -211,3 +211,15 @@ export async function setConfig(patch: Partial<Pick<ConfigView, "default_shell"
|
||||
accent: patch.accent ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
export async function shutdownDaemon(): Promise<void> {
|
||||
try { await invoke("shutdown_daemon"); } catch { /* connection drops as the daemon exits — expected */ }
|
||||
}
|
||||
|
||||
export async function restartDaemon(): Promise<void> {
|
||||
await shutdownDaemon();
|
||||
// Let the old process exit; the next request triggers the bridge's
|
||||
// ensure_daemon respawn (or launchd KeepAlive) and reconnects.
|
||||
await new Promise((r) => setTimeout(r, 600));
|
||||
try { await getHealth(); } catch { /* reconnect loop will retry */ }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user