forked from Kieran/snort
fix: logged out lang
This commit is contained in:
parent
732a895a58
commit
7088bee14d
@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user