Guard language switching failures (#1002)

This commit is contained in:
ZacharyZcR
2026-07-10 08:01:48 +08:00
committed by GitHub
parent 57effd2405
commit d908d9dc57
6 changed files with 80 additions and 37 deletions
+2 -2
View File
@@ -63,6 +63,7 @@ import { ConnectionsPanel } from "@/sidebar/ConnectionsPanel";
import { TransferMonitor } from "@/features/file-manager/TransferMonitor.tsx";
import { sshHostToHost } from "@/sidebar/HostManagerData";
import { resolveHostTabType } from "@/lib/host-connection-tabs";
import { changeAppLanguage } from "@/i18n/i18n";
function buildHostTree(
hosts: SSHHostWithStatus[],
@@ -618,8 +619,7 @@ export function AppShell({
applyAccentColor(prefs.accentColor);
}
if (prefs.language && prefs.language !== i18n.language) {
localStorage.setItem("i18nextLng", prefs.language);
void i18n.changeLanguage(prefs.language);
void changeAppLanguage(prefs.language);
}
if (
prefs.commandAutocomplete !== null &&