aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/theme/theme.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/theme/theme.service.ts')
-rw-r--r--client/src/app/core/theme/theme.service.ts11
1 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 40939ecb8..ead1770ba 100644
--- a/client/src/app/core/theme/theme.service.ts
+++ b/client/src/app/core/theme/theme.service.ts
@@ -1,4 +1,5 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { logger } from '@root-helpers/logger'
2import { capitalizeFirstLetter } from '@root-helpers/string' 3import { capitalizeFirstLetter } from '@root-helpers/string'
3import { UserLocalStorageKeys } from '@root-helpers/users' 4import { UserLocalStorageKeys } from '@root-helpers/users'
4import { HTMLServerConfig, ServerConfigTheme } from '@shared/models' 5import { HTMLServerConfig, ServerConfigTheme } from '@shared/models'
@@ -57,7 +58,7 @@ export class ThemeService {
57 private injectThemes (themes: ServerConfigTheme[], fromLocalStorage = false) { 58 private injectThemes (themes: ServerConfigTheme[], fromLocalStorage = false) {
58 this.themes = themes 59 this.themes = themes
59 60
60 console.log('Injecting %d themes.', this.themes.length) 61 logger.info(`Injecting ${this.themes.length} themes.`)
61 62
62 const head = this.getHeadElement() 63 const head = this.getHeadElement()
63 64
@@ -117,13 +118,13 @@ export class ThemeService {
117 118
118 const currentTheme = this.getCurrentTheme() 119 const currentTheme = this.getCurrentTheme()
119 120
120 console.log('Enabling %s theme.', currentTheme) 121 logger.info(`Enabling ${currentTheme} theme.`)
121 122
122 this.loadTheme(currentTheme) 123 this.loadTheme(currentTheme)
123 124
124 const theme = this.getTheme(currentTheme) 125 const theme = this.getTheme(currentTheme)
125 if (theme) { 126 if (theme) {
126 console.log('Adding scripts of theme %s.', currentTheme) 127 logger.info(`Adding scripts of theme ${currentTheme}`)
127 128
128 this.pluginService.addPlugin(theme, true) 129 this.pluginService.addPlugin(theme, true)
129 130
@@ -165,7 +166,7 @@ export class ThemeService {
165 this.injectThemes([ lastActiveTheme ], true) 166 this.injectThemes([ lastActiveTheme ], true)
166 this.updateCurrentTheme() 167 this.updateCurrentTheme()
167 } catch (err) { 168 } catch (err) {
168 console.error('Cannot parse last active theme.', err) 169 logger.error('Cannot parse last active theme.', err)
169 return 170 return
170 } 171 }
171 } 172 }
@@ -173,7 +174,7 @@ export class ThemeService {
173 private removeThemePlugins (themeName: string) { 174 private removeThemePlugins (themeName: string) {
174 const oldTheme = this.getTheme(themeName) 175 const oldTheme = this.getTheme(themeName)
175 if (oldTheme) { 176 if (oldTheme) {
176 console.log('Removing scripts of old theme %s.', themeName) 177 logger.info(`Removing scripts of old theme ${themeName}.`)
177 this.pluginService.removePlugin(oldTheme) 178 this.pluginService.removePlugin(oldTheme)
178 } 179 }
179 } 180 }