fix: preserve admin view on language change

This commit is contained in:
3252a8
2026-05-28 09:54:27 +03:00
parent 6c0d2932c3
commit 12e60629fe
3 changed files with 105 additions and 28 deletions
@@ -346,7 +346,7 @@ export function createAccountStore({
window.location.assign(buildTelegramOAuthStartUrl("link", getTg()));
}
async function updateAccountLanguage(nextValue) {
async function updateAccountLanguage(nextValue, options = {}) {
const s = get(state);
const normalize = typeof normalizeLangCode === "function" ? normalizeLangCode : (v) => v;
const language = normalize(nextValue);
@@ -361,7 +361,7 @@ export function createAccountStore({
if (typeof updateLocalData === "function") {
updateLocalData(normalize(response.language || language));
}
await loadData({ fresh: true });
await loadData({ fresh: true, preserveView: true, ...options });
} catch {
showToast(t("wa_settings_language_update_failed"));
} finally {