fix(client): await `clipboard.writeText` so that fallback works in non-secure contexts (#5119)

pull/5123/head
Qingpeng Li 5 months ago committed by GitHub
parent b28667b6b0
commit b544df802d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

Loading…
Cancel
Save