Skip to content

Commit 79b9200

Browse files
committed
fix: 下载配置未正常保存导致同步失败
1 parent 9c6a48a commit 79b9200

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/core/setting/components/upload-store.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ export default function UploadStore() {
7878
if (file) {
7979
const configJson = decodeBase64ToString(file.content)
8080
const store = await Store.load('store.json');
81-
Object.keys(JSON.parse(configJson)).forEach(key => {
82-
store.set(key, JSON.parse(configJson)[key])
83-
})
81+
const keys = Object.keys(JSON.parse(configJson))
82+
await Promise.allSettled(keys.map(async key => await store.set(key, JSON.parse(configJson)[key])))
83+
await store.save()
8484
if (isMobileDevice()) {
8585
toast({
8686
description: t('downloadSuccess'),

0 commit comments

Comments
 (0)