mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-29 18:19:06 +01:00
Fix:Copy to clipboard
This commit is contained in:
parent
9a73e352d1
commit
e97d92a8ac
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user