aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/theme/theme.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-06 15:25:19 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-07 08:55:02 +0200
commita4ff3100d36f2fe9a4dfc00e8487c28a94433c4f (patch)
tree1744c9db32b765b1511d4a69a7ba7b525dc0f619 /client/src/app/core/theme/theme.service.ts
parenta02b93ce756d646a59cef57b5e4ff53c2bb30bec (diff)
downloadPeerTube-a4ff3100d36f2fe9a4dfc00e8487c28a94433c4f.tar.gz
PeerTube-a4ff3100d36f2fe9a4dfc00e8487c28a94433c4f.tar.zst
PeerTube-a4ff3100d36f2fe9a4dfc00e8487c28a94433c4f.zip
Cleanup tokens logic in embed
Diffstat (limited to 'client/src/app/core/theme/theme.service.ts')
-rw-r--r--client/src/app/core/theme/theme.service.ts16
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 @@
1import { first } from 'rxjs/operators' 1import { first } from 'rxjs/operators'
2import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
3import { UserLocalStorageKeys } from '@root-helpers/users'
4import { ServerConfig, ServerConfigTheme } from '@shared/models'
5import { environment } from '../../../environments/environment'
3import { AuthService } from '../auth' 6import { AuthService } from '../auth'
4import { PluginService } from '../plugins/plugin.service' 7import { PluginService } from '../plugins/plugin.service'
5import { ServerService } from '../server' 8import { ServerService } from '../server'
6import { LocalStorageService } from '../wrappers/storage.service'
7import { User } from '../users/user.model'
8import { UserService } from '../users/user.service' 9import { UserService } from '../users/user.service'
9import { ServerConfig, ServerConfigTheme } from '@shared/models' 10import { LocalStorageService } from '../wrappers/storage.service'
10import { environment } from '../../../environments/environment'
11 11
12@Injectable() 12@Injectable()
13export class ThemeService { 13export 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 {