From df22efa9801f7cbdb2e6d98a752257360a5980d5 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Thu, 27 Aug 2020 15:26:47 +0200 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=94=B6=E8=97=8F=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Setting.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Setting.vue b/src/components/Setting.vue index 747c4b8..ad194bf 100644 --- a/src/components/Setting.vue +++ b/src/components/Setting.vue @@ -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() })