Improved auth views and imrpoved default settings handling #70

This commit is contained in:
2022-10-18 18:04:53 +02:00
parent f553779797
commit a51efa641d
21 changed files with 569 additions and 376 deletions

View File

@@ -41,7 +41,7 @@ export class ThemeService {
const mail = this.authService.getEMailFromDecodedToken(token);
let defaultThemeName = localStorage.getItem(`default_themeName`);
if (!defaultThemeName || defaultThemeName != Themes.Default) {
if (!defaultThemeName) {
defaultThemeName = Themes.Default;
}
@@ -58,7 +58,13 @@ export class ThemeService {
this.setTheme(userThemeName);
}
setTheme(name: string): void {
setTheme(name: string, isDefault: boolean = false): void {
if (isDefault) {
localStorage.setItem(`default_themeName`, name);
this.themeName$.next(name);
return;
}
this.authService.isUserLoggedInAsync().then(result => {
if (!result) {
localStorage.setItem(`default_themeName`, Themes.Default);