From e97d92a8ac5b7ee88bd4b156181ff6f2ddf225c5 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 27 Nov 2022 17:10:06 -0600 Subject: [PATCH] Fix:Copy to clipboard --- client/plugins/init.client.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/plugins/init.client.js b/client/plugins/init.client.js index a208f387..bc185c5f 100644 --- a/client/plugins/init.client.js +++ b/client/plugins/init.client.js @@ -94,13 +94,11 @@ Vue.prototype.$sanitizeSlug = (str) => { Vue.prototype.$copyToClipboard = (str, ctx) => { return new Promise((resolve) => { - if (!navigator.clipboard) { + if (navigator.clipboard) { navigator.clipboard.writeText(str).then(() => { if (ctx) ctx.$toast.success('Copied to clipboard') - resolve(true) }, (err) => { console.error('Clipboard copy failed', str, err) - resolve(false) }) } else { const el = document.createElement('textarea')