🐛 Fix: auto-copy option && copy style

auto-copy option not work && clear rules for line breaks when copying
This commit is contained in:
Molunerfinn
2020-05-04 16:50:29 +08:00
parent 2adff1e788
commit b6e3adb7af
5 changed files with 14 additions and 14 deletions

View File

@@ -383,22 +383,22 @@ export default class extends Vue {
}
multiCopy () {
if (Object.values(this.choosedList).some(item => item)) {
let copyString = ''
const copyString: string[] = []
const style = this.$db.get('settings.pasteStyle') || 'markdown'
// choosedList -> { [id]: true or false }; true means choosed. false means not choosed.
Object.keys(this.choosedList).forEach(key => {
if (this.choosedList[key]) {
const item = this.$db.getById('uploaded', key)
copyString += pasteStyle(style, item) + '\n'
copyString.push(pasteStyle(style, item))
this.choosedList[key] = false
}
})
const obj = {
title: '批量复制链接成功',
body: copyString
body: copyString.join('\n')
}
const myNotification = new Notification(obj.title, obj)
clipboard.writeText(copyString)
clipboard.writeText(copyString.join('\n'))
myNotification.onclick = () => {
return true
}