fix: avoid daemon runtime prompt under spinner

This commit is contained in:
Ayaan Zaidi
2026-01-27 22:31:48 +05:30
committed by Ayaan Zaidi
parent 4a9c921168
commit 0ad40f4d7c

View File

@@ -66,20 +66,23 @@ export async function maybeInstallDaemon(params: {
if (shouldInstall) {
let installError: string | null = null;
if (!params.daemonRuntime) {
if (GATEWAY_DAEMON_RUNTIME_OPTIONS.length === 1) {
daemonRuntime = GATEWAY_DAEMON_RUNTIME_OPTIONS[0]?.value ?? DEFAULT_GATEWAY_DAEMON_RUNTIME;
} else {
daemonRuntime = guardCancel(
await select({
message: "Gateway service runtime",
options: GATEWAY_DAEMON_RUNTIME_OPTIONS,
initialValue: DEFAULT_GATEWAY_DAEMON_RUNTIME,
}),
params.runtime,
) as GatewayDaemonRuntime;
}
}
await withProgress(
{ label: "Gateway service", indeterminate: true, delayMs: 0 },
async (progress) => {
if (!params.daemonRuntime) {
daemonRuntime = guardCancel(
await select({
message: "Gateway service runtime",
options: GATEWAY_DAEMON_RUNTIME_OPTIONS,
initialValue: DEFAULT_GATEWAY_DAEMON_RUNTIME,
}),
params.runtime,
) as GatewayDaemonRuntime;
}
progress.setLabel("Preparing Gateway service…");
const cfg = loadConfig();