From d307465db044684b5bde92aa03080b0bfe5481fd Mon Sep 17 00:00:00 2001 From: troyeguo <13820674+troyeguo@users.noreply.github.com> Date: Sun, 15 Feb 2026 15:38:17 +0800 Subject: [PATCH] feat: Enhance iCloud Drive error message and update cloud config token handling --- src/assets/locales/zh-CN/translation.json | 1 + src/containers/settings/syncSetting/component.tsx | 4 +++- src/utils/file/common.ts | 10 +++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/assets/locales/zh-CN/translation.json b/src/assets/locales/zh-CN/translation.json index 0f0e917b..9664a45c 100644 --- a/src/assets/locales/zh-CN/translation.json +++ b/src/assets/locales/zh-CN/translation.json @@ -412,6 +412,7 @@ "AI voice is only available for Pro users, please upgrade to Pro to use this feature": "AI 语音仅付费用户可用,您可以在手机版进行试听", "I've paid": "我已支付", "Importing": "导入中", + "Can't find iCloud Drive folder in the default path, please make sure iCloud Drive is installed and set up correctly": "在默认路径未找到 iCloud Drive 文件夹,请确保已正确安装和设置 iCloud Drive", "Summarize this chapter for me": "帮我总结这一章的内容", "What are the key points of this chapter": "整理并输出格式清晰的内容要点", "Remove data source": "移除数据源", diff --git a/src/containers/settings/syncSetting/component.tsx b/src/containers/settings/syncSetting/component.tsx index fab11f13..92959f5d 100644 --- a/src/containers/settings/syncSetting/component.tsx +++ b/src/containers/settings/syncSetting/component.tsx @@ -118,7 +118,9 @@ class SyncSetting extends React.Component { let drivePath = getICloudDrivePath(); if (!drivePath) { toast.error( - this.props.t("Can't find iCloud Drive folder in the default path") + this.props.t( + "Can't find iCloud Drive folder in the default path, please make sure iCloud Drive is installed and set up correctly" + ) ); this.props.handleSettingDrive(""); return; diff --git a/src/utils/file/common.ts b/src/utils/file/common.ts index 2fb0858a..7a550d0b 100644 --- a/src/utils/file/common.ts +++ b/src/utils/file/common.ts @@ -265,7 +265,15 @@ export const getCloudConfig = async (service: string) => { if (!config) { return {}; } - return await prepareThirdConfig(service, config); + let newConfig = await prepareThirdConfig(service, config); + if ( + newConfig.access_token && + newConfig.access_token !== config.access_token + ) { + console.log("Token updated for service:", service); + return { ...newConfig, isUseCache: false }; + } + return newConfig; }; export const getCloudToken = async (service: string) => { if (configCache[service]) {