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 | |
parent | cb4eb74485c2044effdc7e43f4f5f92d430d2bc0 (diff) | |
download | PeerTube-7c87bce4715ca291c8e449d9de3d92c69725d45c.tar.gz PeerTube-7c87bce4715ca291c8e449d9de3d92c69725d45c.tar.zst PeerTube-7c87bce4715ca291c8e449d9de3d92c69725d45c.zip |
Fix anonymous user theme
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/core/theme/theme.service.ts | 8 | ||||
-rw-r--r-- | client/src/app/core/users/user.model.ts | 3 |
2 files changed, 6 insertions, 5 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 { |
diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts index 6a56786d9..4256f370b 100644 --- a/client/src/app/core/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts | |||
@@ -23,7 +23,8 @@ export class User implements UserServerModel { | |||
23 | AUTO_PLAY_VIDEO: 'auto_play_video', | 23 | AUTO_PLAY_VIDEO: 'auto_play_video', |
24 | SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO: 'auto_play_next_video', | 24 | SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO: 'auto_play_next_video', |
25 | AUTO_PLAY_VIDEO_PLAYLIST: 'auto_play_video_playlist', | 25 | AUTO_PLAY_VIDEO_PLAYLIST: 'auto_play_video_playlist', |
26 | THEME: 'last_active_theme', | 26 | THEME: 'theme', |
27 | LAST_ACTIVE_THEME: 'last_active_theme', | ||
27 | VIDEO_LANGUAGES: 'video_languages' | 28 | VIDEO_LANGUAGES: 'video_languages' |
28 | } | 29 | } |
29 | 30 | ||