From b544df802d256aef10d4da94631967b0fcab68d2 Mon Sep 17 00:00:00 2001 From: Qingpeng Li <43924785+qingpeng9802@users.noreply.github.com> Date: Sat, 14 Feb 2026 22:27:59 +0800 Subject: [PATCH] fix(client): await `clipboard.writeText` so that fallback works in non-secure contexts (#5119) --- src/client/app/composables/copyCode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/composables/copyCode.ts b/src/client/app/composables/copyCode.ts index 3d920a854..f0fc998d8 100644 --- a/src/client/app/composables/copyCode.ts +++ b/src/client/app/composables/copyCode.ts @@ -48,7 +48,7 @@ export function useCopyCode() { async function copyToClipboard(text: string) { try { - return navigator.clipboard.writeText(text) + await navigator.clipboard.writeText(text) } catch { const element = document.createElement('textarea') const previouslyFocusedElement = document.activeElement