fix: 修复Nutstore设置中的自动同步状态和错误消息内容 (#6452)

- 在NutstoreSettings组件中,添加了设置Nutstore自动同步状态的逻辑。
- 更新NutstoreService中的错误消息内容,确保使用正确的国际化键。
This commit is contained in:
Roland 2025-05-26 11:46:26 +08:00 committed by GitHub
parent d90ac44945
commit e854ef8757
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -94,6 +94,7 @@ const NutstoreSettings: FC = () => {
if (confirmedLogout) {
dispatch(setNutstoreToken(''))
dispatch(setNutstorePath(''))
dispatch(setNutstoreAutoSync(false))
setNutstoreUsername('')
setStoragePath(undefined)
}

View File

@ -13,7 +13,7 @@ function getNutstoreToken() {
const nutstoreToken = store.getState().nutstore.nutstoreToken
if (!nutstoreToken) {
window.message.error({ content: i18n.t('error.invalid.nutstore_token'), key: 'nutstore' })
window.message.error({ content: i18n.t('message.error.invalid.nutstore_token'), key: 'nutstore' })
return null
}
return nutstoreToken
@ -164,8 +164,9 @@ export async function startNutstoreAutoSync() {
}
const nutstoreToken = getNutstoreToken()
if (!nutstoreToken) {
window.message.error({ content: i18n.t('error.invalid.nutstore_token'), key: 'nutstore' })
Logger.log('[startNutstoreAutoSync] Invalid nutstore token, nutstore auto sync disabled')
return
}