diff options
Diffstat (limited to 'client/src/app/core/theme/theme.service.ts')
-rw-r--r-- | client/src/app/core/theme/theme.service.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/client/src/app/core/theme/theme.service.ts b/client/src/app/core/theme/theme.service.ts index 7e05fdddd..4c4611d01 100644 --- a/client/src/app/core/theme/theme.service.ts +++ b/client/src/app/core/theme/theme.service.ts | |||
@@ -1,13 +1,13 @@ | |||
1 | import { first } from 'rxjs/operators' | 1 | import { first } from 'rxjs/operators' |
2 | import { Injectable } from '@angular/core' | 2 | import { Injectable } from '@angular/core' |
3 | import { UserLocalStorageKeys } from '@root-helpers/users' | ||
4 | import { ServerConfig, ServerConfigTheme } from '@shared/models' | ||
5 | import { environment } from '../../../environments/environment' | ||
3 | import { AuthService } from '../auth' | 6 | import { AuthService } from '../auth' |
4 | import { PluginService } from '../plugins/plugin.service' | 7 | import { PluginService } from '../plugins/plugin.service' |
5 | import { ServerService } from '../server' | 8 | import { ServerService } from '../server' |
6 | import { LocalStorageService } from '../wrappers/storage.service' | ||
7 | import { User } from '../users/user.model' | ||
8 | import { UserService } from '../users/user.service' | 9 | import { UserService } from '../users/user.service' |
9 | import { ServerConfig, ServerConfigTheme } from '@shared/models' | 10 | import { LocalStorageService } from '../wrappers/storage.service' |
10 | import { environment } from '../../../environments/environment' | ||
11 | 11 | ||
12 | @Injectable() | 12 | @Injectable() |
13 | export class ThemeService { | 13 | export class ThemeService { |
@@ -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.LAST_ACTIVE_THEME, JSON.stringify(theme), false) | 114 | this.localStorageService.setItem(UserLocalStorageKeys.LAST_ACTIVE_THEME, JSON.stringify(theme), false) |
115 | } else { | 115 | } else { |
116 | this.localStorageService.removeItem(User.KEYS.LAST_ACTIVE_THEME, false) | 116 | this.localStorageService.removeItem(UserLocalStorageKeys.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([ UserLocalStorageKeys.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.LAST_ACTIVE_THEME) | 141 | const lastActiveThemeString = this.localStorageService.getItem(UserLocalStorageKeys.LAST_ACTIVE_THEME) |
142 | if (!lastActiveThemeString) return | 142 | if (!lastActiveThemeString) return |
143 | 143 | ||
144 | try { | 144 | try { |