ui: sync lang button active state on initial load and refresh

This commit is contained in:
user
2026-04-27 20:39:31 +09:00
parent e2d301d28d
commit f26600ec95

View File

@@ -518,6 +518,10 @@ if (!localStorage.getItem("tutor_lang")) {
} }
updateStaticText(); updateStaticText();
const savedLang = localStorage.getItem("tutor_lang") || document.documentElement.lang || "ko";
document.querySelectorAll(".lang-btn").forEach((btn) => {
btn.classList.toggle("is-active", btn.dataset.lang === savedLang);
});
window.renderAuth = renderAuth; window.renderAuth = renderAuth;
window.setLanguage = setLanguage; window.setLanguage = setLanguage;
renderAuth(); renderAuth();