From 13a4153be40ba95983989ccee61869c36efe3d87 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Sat, 24 Oct 2026 13:35:56 +0200 Subject: [PATCH] copy-text: load the toast store only when copying, so the Markdown renderer still renders without a browser --- apps/host/src/lib/copy-text.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/host/src/lib/copy-text.ts b/apps/host/src/lib/copy-text.ts index 243f3139..c4881936 100644 --- a/apps/host/src/lib/copy-text.ts +++ b/apps/host/src/lib/copy-text.ts @@ -1,5 +1,3 @@ -import { pushToast } from './store'; - /** * Put text on the clipboard. The browser clipboard call can be refused inside the app window (WebView2 asks no one and says no), * so a hidden text field and the older copy command are the second try. Resolves true when one of them worked. @@ -30,6 +28,8 @@ export async function copyText(value: string): Promise { /** Copy and say so: "Copied", or "Couldn't copy" with what to do instead. */ export async function copyAndTell(value: string, label: string): Promise { + // loaded here, not at the top: the store needs a browser, and the Markdown renderer (which copies code) is also rendered without one + const { pushToast } = await import('./store'); if (await copyText(value)) pushToast('success', 'Copied', label); else