upfix localstorage iframe

This commit is contained in:
_Bastler
2022-03-20 11:21:25 +01:00
parent 578e6e6981
commit 5a9caf69a5
6 changed files with 68 additions and 37 deletions
+12 -7
View File
@@ -58,17 +58,20 @@ export class MainComponent {
} else {
this.opened = true;
}
if (localStorage.getItem("bstly.darkTheme") == "true") {
this.darkTheme = "true";
window.document.body.classList.add("dark-theme");
}
try {
if (localStorage.getItem("bstly.darkTheme") == "true") {
this.darkTheme = "true";
window.document.body.classList.add("dark-theme");
}
} catch { }
this.touchEvents();
}
setLocale(locale) {
localStorage.setItem("bstly.locale", locale);
try {
localStorage.setItem("bstly.locale", locale);
} catch { }
if (this.auth && this.auth.authenticated) {
this.profileService.getField("locale").subscribe({
@@ -102,7 +105,9 @@ export class MainComponent {
this.darkTheme = "false";
}
localStorage.setItem("bstly.darkTheme", this.darkTheme);
try {
localStorage.setItem("bstly.darkTheme", this.darkTheme);
} catch { }
if (this.auth && this.auth.authenticated) {
this.profileService.getField("darkTheme").subscribe({