feat: Enhance iCloud Drive error message and update cloud config token handling

This commit is contained in:
troyeguo
2026-02-15 15:38:17 +08:00
parent da1e0b79a8
commit d307465db0
3 changed files with 13 additions and 2 deletions

View File

@@ -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": "移除数据源",

View File

@@ -118,7 +118,9 @@ class SyncSetting extends React.Component<SettingInfoProps, SettingInfoState> {
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;

View File

@@ -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]) {