diff options
author | Chocobozzz <me@florianbigard.com> | 2020-07-31 16:55:32 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-07-31 16:55:32 +0200 |
commit | 7c87bce4715ca291c8e449d9de3d92c69725d45c (patch) | |
tree | 73b3ea127ded33ace48dd1672758a272daba8fc3 /client/src/app/core/theme | |
parent | cb4eb74485c2044effdc7e43f4f5f92d430d2bc0 (diff) | |
download | PeerTube-7c87bce4715ca291c8e449d9de3d92c69725d45c.tar.gz PeerTube-7c87bce4715ca291c8e449d9de3d92c69725d45c.tar.zst PeerTube-7c87bce4715ca291c8e449d9de3d92c69725d45c.zip |
Fix anonymous user theme
Diffstat (limited to 'client/src/app/core/theme')
-rw-r--r-- | client/src/app/core/theme/theme.service.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/client/src/app/core/theme/theme.service.ts b/client/src/app/core/theme/theme.service.ts index 9dbf22e20..7e05fdddd 100644 --- a/client/src/app/core/theme/theme.service.ts +++ b/client/src/app/core/theme/theme.service.ts | |||
@@ -111,9 +111,9 @@ export class ThemeService { | |||
111 | 111 | ||
112 | this.pluginService.reloadLoadedScopes() | 112 | this.pluginService.reloadLoadedScopes() |
113 | 113 | ||
114 | this.localStorageService.setItem(User.KEYS.THEME, JSON.stringify(theme), false) | 114 | this.localStorageService.setItem(User.KEYS.LAST_ACTIVE_THEME, JSON.stringify(theme), false) |
115 | } else { | 115 | } else { |
116 | this.localStorageService.removeItem(User.KEYS.THEME, false) | 116 | this.localStorageService.removeItem(User.KEYS.LAST_ACTIVE_THEME, false) |
117 | } | 117 | } |
118 | 118 | ||
119 | this.oldThemeName = currentTheme | 119 | this.oldThemeName = currentTheme |
@@ -127,7 +127,7 @@ export class ThemeService { | |||
127 | if (!this.auth.isLoggedIn()) { | 127 | if (!this.auth.isLoggedIn()) { |
128 | this.updateCurrentTheme() | 128 | this.updateCurrentTheme() |
129 | 129 | ||
130 | this.localStorageService.watch([User.KEYS.THEME]).subscribe( | 130 | this.localStorageService.watch([ User.KEYS.THEME ]).subscribe( |
131 | () => this.updateCurrentTheme() | 131 | () => this.updateCurrentTheme() |
132 | ) | 132 | ) |
133 | } | 133 | } |
@@ -138,7 +138,7 @@ export class ThemeService { | |||
138 | } | 138 | } |
139 | 139 | ||
140 | private loadAndSetFromLocalStorage () { | 140 | private loadAndSetFromLocalStorage () { |
141 | const lastActiveThemeString = this.localStorageService.getItem(User.KEYS.THEME) | 141 | const lastActiveThemeString = this.localStorageService.getItem(User.KEYS.LAST_ACTIVE_THEME) |
142 | if (!lastActiveThemeString) return | 142 | if (!lastActiveThemeString) return |
143 | 143 | ||
144 | try { | 144 | try { |