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);
};
class LangStore extends ExternalStore<string> {
class LangStore extends ExternalStore<string | null> {
setLang(s: string) {
localStorage.setItem("lang", s);
this.notifyChange();
}
takeSnapshot(): string {
return localStorage.getItem("lang") ?? DefaultLocale;
takeSnapshot() {
return localStorage.getItem("lang");
}
}