Fixed: multi copy bug

This commit is contained in:
Molunerfinn 2018-07-24 23:15:19 +08:00
parent 930e4e663b
commit 396faa2c60

View File

@ -155,7 +155,7 @@ export default {
const myNotification = new window.Notification(obj.title, obj) const myNotification = new window.Notification(obj.title, obj)
this.$electron.clipboard.writeText(copyLink) this.$electron.clipboard.writeText(copyLink)
myNotification.onclick = () => { myNotification.onclick = () => {
console.log(123) return true
} }
}, },
remove (id) { remove (id) {
@ -242,22 +242,23 @@ export default {
} }
}, },
multiCopy () { multiCopy () {
let copyString = '' if (Object.values(this.choosedList).some(item => item)) {
const style = this.$db.read().get('picBed.pasteStyle').value() || 'markdown' let copyString = ''
Object.keys(this.choosedList).forEach(key => { const style = this.$db.read().get('picBed.pasteStyle').value() || 'markdown'
if (this.choosedList[key]) { Object.keys(this.choosedList).forEach(key => {
console.log(pasteStyle(style, this.$db.read().get('uploaded').getById(key).value().imgUrl), style) if (this.choosedList[key]) {
copyString += pasteStyle(style, this.$db.read().get('uploaded').getById(key).value().imgUrl) + '\n' copyString += pasteStyle(style, this.$db.read().get('uploaded').getById(key).value().imgUrl) + '\n'
}
})
const obj = {
title: '批量复制链接成功',
body: copyString
}
const myNotification = new window.Notification(obj.title, obj)
this.$electron.clipboard.writeText(copyString)
myNotification.onclick = () => {
return true
} }
})
const obj = {
title: '复制链接成功',
body: copyString
}
const myNotification = new window.Notification(obj.title, obj)
this.$electron.clipboard.writeText(copyString)
myNotification.onclick = () => {
return true
} }
}, },
toggleHandleBar () { toggleHandleBar () {