diff --git a/lib/prompts/store.ts b/lib/prompts/store.ts index a9213a7e..0d6e3032 100644 --- a/lib/prompts/store.ts +++ b/lib/prompts/store.ts @@ -420,9 +420,15 @@ export class PromptStore { } private ensureDefaultFiles(): void { + if (existsSync(this.paths.defaultsDir)) { + return + } + try { mkdirSync(this.paths.defaultsDir, { recursive: true }) - mkdirSync(this.paths.globalOverridesDir, { recursive: true }) + if (!existsSync(this.paths.globalOverridesDir)) { + mkdirSync(this.paths.globalOverridesDir, { recursive: true }) + } } catch { this.logger.warn("Failed to initialize prompt directories", { defaultsDir: this.paths.defaultsDir, diff --git a/lib/v2/tui.tsx b/lib/v2/tui.tsx index 29843135..c048e7ea 100644 --- a/lib/v2/tui.tsx +++ b/lib/v2/tui.tsx @@ -8,7 +8,6 @@ import { panelTheme } from "./theme" export async function setup(ctx: Plugin.Context) { const client = ctx.client.rpc(rpc) const options = () => ({ location: ctx.location ?? ctx.data.location.default() }) - if (!(await client.status({}, options())).enabled) return const api: ViewApi = { renderer: ctx.renderer, theme: { @@ -37,6 +36,18 @@ export async function setup(ctx: Plugin.Context) { } const sessionID = route.sessionID try { + const status = await client.status({}, options()) + if (!status.enabled) { + show(() => ( + + )) + return + } const data = await client.snapshot({ sessionID }, options()) const back = () => { void open()