From e5a6b2fb52c9d55345df10a588c035745056ab2e Mon Sep 17 00:00:00 2001 From: lyswhut Date: Thu, 19 Dec 2024 00:15:20 +0800 Subject: [PATCH] Fix eslint error --- .vscode/settings.json | 3 ++- src/screens/Home/Views/Setting/settings/Backup/actions.ts | 8 ++++++-- .../Home/Views/Setting/settings/Other/ResourceCache.tsx | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b621e29..d79d056 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,6 @@ "google-cn", "google" ], - "i18n-ally.sortKeys": true + "i18n-ally.sortKeys": true, + "typescript.tsdk": "packages/shared/eslint/node_modules/typescript/lib", } diff --git a/src/screens/Home/Views/Setting/settings/Backup/actions.ts b/src/screens/Home/Views/Setting/settings/Backup/actions.ts index b134596..0684eb8 100644 --- a/src/screens/Home/Views/Setting/settings/Backup/actions.ts +++ b/src/screens/Home/Views/Setting/settings/Backup/actions.ts @@ -87,8 +87,12 @@ export const handleImportListPart = async(listData: LX.ConfigFile.MyListInfoPart }) if (confirm) { listData.name = targetList.name - void overwriteList(listData) - toast(global.i18n.t('setting_backup_part_import_list_tip_success')) + void overwriteList(listData).then(() => { + toast(global.i18n.t('setting_backup_part_import_list_tip_success')) + }).catch((err) => { + log.error(err) + toast(global.i18n.t('setting_backup_part_import_list_tip_error')) + }) return } listData.id += `__${Date.now()}` diff --git a/src/screens/Home/Views/Setting/settings/Other/ResourceCache.tsx b/src/screens/Home/Views/Setting/settings/Other/ResourceCache.tsx index 4f05533..df0c437 100644 --- a/src/screens/Home/Views/Setting/settings/Other/ResourceCache.tsx +++ b/src/screens/Home/Views/Setting/settings/Other/ResourceCache.tsx @@ -24,7 +24,7 @@ export default memo(() => { const handleGetAppCacheSize = () => { void Promise.all([getAppCacheSize(), getCacheSize()]).then(([size, size2]) => { const count = size + size2 - setCacheSize(sizeFormate(count as number)) + setCacheSize(sizeFormate(count)) }) }