Add missing await
This commit is contained in:
@ -8,7 +8,7 @@ export const useCopy = (timeout = 2000) => {
|
|||||||
setError(false);
|
setError(false);
|
||||||
try {
|
try {
|
||||||
if (navigator.clipboard && window.isSecureContext) {
|
if (navigator.clipboard && window.isSecureContext) {
|
||||||
navigator.clipboard.writeText(text);
|
await navigator.clipboard.writeText(text);
|
||||||
} else {
|
} else {
|
||||||
const textArea = document.createElement("textarea");
|
const textArea = document.createElement("textarea");
|
||||||
textArea.value = text;
|
textArea.value = text;
|
||||||
|
Reference in New Issue
Block a user