From 396faa2c607a22b9e6f1933ca3b31b13a24f9487 Mon Sep 17 00:00:00 2001 From: Molunerfinn Date: Tue, 24 Jul 2018 23:15:19 +0800 Subject: [PATCH] Fixed: multi copy bug --- .../components/SettingView/Gallery.vue | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/renderer/components/SettingView/Gallery.vue b/src/renderer/components/SettingView/Gallery.vue index e054c86..765e104 100644 --- a/src/renderer/components/SettingView/Gallery.vue +++ b/src/renderer/components/SettingView/Gallery.vue @@ -155,7 +155,7 @@ export default { const myNotification = new window.Notification(obj.title, obj) this.$electron.clipboard.writeText(copyLink) myNotification.onclick = () => { - console.log(123) + return true } }, remove (id) { @@ -242,22 +242,23 @@ export default { } }, multiCopy () { - let copyString = '' - const style = this.$db.read().get('picBed.pasteStyle').value() || 'markdown' - Object.keys(this.choosedList).forEach(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' + if (Object.values(this.choosedList).some(item => item)) { + let copyString = '' + const style = this.$db.read().get('picBed.pasteStyle').value() || 'markdown' + Object.keys(this.choosedList).forEach(key => { + if (this.choosedList[key]) { + 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 () {