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