upfix localstorage iframe
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user