Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix(web): isolate locale rollback failure from original save error

程凯a668f43a7be9
diff --git a/jiuwenswarm/channels/web/frontend/src/features/settings/services/SettingsSourceProvider.tsx b/jiuwenswarm/channels/web/frontend/src/features/settings/services/SettingsSourceProvider.tsx
index 8ad6370f77..bc0ad516f5 100644
--- a/jiuwenswarm/channels/web/frontend/src/features/settings/services/SettingsSourceProvider.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/features/settings/services/SettingsSourceProvider.tsx
@@ -204,7 +204,11 @@ function LocaleSourceProvider({ children }: { children: ReactNode }) {
return await saveQueue.enqueue(operation, () => request('locale.set_conf', { preferred_language: next }));
} catch (saveError) {
setLanguage(previous);
- await i18n.changeLanguage(previous);
+ try {
+ await i18n.changeLanguage(previous);
+ } catch {
+ // 回滚失败不掩盖原始保存错误
+ }
throw saveError;
} finally {
setSavingKeys(new Set());