fix: logged out lang

This commit is contained in:
Kieran 2023-11-08 15:41:42 +00:00
parent 732a895a58
commit 7088bee14d
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -81,14 +81,14 @@ const getMessages = (locale: string) => {
return matchLang(locale) ?? matchLang(truncatedLocale) ?? Promise.resolve(enMessages); return matchLang(locale) ?? matchLang(truncatedLocale) ?? Promise.resolve(enMessages);
}; };
class LangStore extends ExternalStore<string> { class LangStore extends ExternalStore<string | null> {
setLang(s: string) { setLang(s: string) {
localStorage.setItem("lang", s); localStorage.setItem("lang", s);
this.notifyChange(); this.notifyChange();
} }
takeSnapshot(): string { takeSnapshot() {
return localStorage.getItem("lang") ?? DefaultLocale; return localStorage.getItem("lang");
} }
} }