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,16 +242,16 @@ export default {
} }
}, },
multiCopy () { multiCopy () {
if (Object.values(this.choosedList).some(item => item)) {
let copyString = '' let copyString = ''
const style = this.$db.read().get('picBed.pasteStyle').value() || 'markdown' const style = this.$db.read().get('picBed.pasteStyle').value() || 'markdown'
Object.keys(this.choosedList).forEach(key => { Object.keys(this.choosedList).forEach(key => {
if (this.choosedList[key]) { if (this.choosedList[key]) {
console.log(pasteStyle(style, this.$db.read().get('uploaded').getById(key).value().imgUrl), style)
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 = { const obj = {
title: '复制链接成功', title: '批量复制链接成功',
body: copyString body: copyString
} }
const myNotification = new window.Notification(obj.title, obj) const myNotification = new window.Notification(obj.title, obj)
@ -259,6 +259,7 @@ export default {
myNotification.onclick = () => { myNotification.onclick = () => {
return true return true
} }
}
}, },
toggleHandleBar () { toggleHandleBar () {
this.handleBarActive = !this.handleBarActive this.handleBarActive = !this.handleBarActive