upfix localstorage iframe
This commit is contained in:
@@ -55,18 +55,22 @@ export class AuthenticatedGuard implements CanActivate {
|
||||
for (let profileField of profileFields) {
|
||||
if (profileField.name == "darkTheme") {
|
||||
darktheme = profileField.value;
|
||||
} else if (profileField.name == "locale" && this.i18nService.locales.indexOf(profileField.value) != -1 && localStorage.getItem("bstly.locale") != profileField.value) {
|
||||
if (this.i18nService.locale != profileField.value) {
|
||||
localStorage.setItem("bstly.locale", profileField.value);
|
||||
updateLocale = true;
|
||||
}
|
||||
} else if (profileField.name == "locale" && this.i18nService.locales.indexOf(profileField.value) != -1) {
|
||||
try {
|
||||
if (localStorage.getItem("bstly.locale") != profileField.value || this.i18nService.locale != profileField.value) {
|
||||
localStorage.setItem("bstly.locale", profileField.value);
|
||||
updateLocale = true;
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
if (darktheme != localStorage.getItem("bstly.darkTheme")) {
|
||||
localStorage.setItem("bstly.darkTheme", darktheme);
|
||||
updateTheme = true;
|
||||
}
|
||||
try {
|
||||
if (darktheme != localStorage.getItem("bstly.darkTheme")) {
|
||||
localStorage.setItem("bstly.darkTheme", darktheme);
|
||||
updateTheme = true;
|
||||
}
|
||||
} catch { }
|
||||
|
||||
if (updateLocale || updateTheme) {
|
||||
window.location.reload();
|
||||
|
||||
Reference in New Issue
Block a user