导入收藏时不清空

This commit is contained in:
haiyangcui
2020-08-27 15:26:47 +02:00
parent 5428891297
commit df22efa980

View File

@@ -290,7 +290,6 @@ export default {
},
upgradeFavorites () {
star.all().then(res => {
star.clear()
res.forEach(element => {
const docs = {
key: element.key,
@@ -301,7 +300,11 @@ export default {
last: element.last,
note: element.note
}
star.add(docs)
star.find({ key: element.key, ids: element.ids }).then(res => {
if (!res) {
star.add(docs)
}
})
})
this.getFavorites()
})