diff options
Diffstat (limited to 'client/src/app/core/theme/theme.service.ts')
-rw-r--r-- | client/src/app/core/theme/theme.service.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/app/core/theme/theme.service.ts b/client/src/app/core/theme/theme.service.ts index a6eef0898..50c19ecac 100644 --- a/client/src/app/core/theme/theme.service.ts +++ b/client/src/app/core/theme/theme.service.ts | |||
@@ -5,7 +5,7 @@ import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' | |||
5 | export class ThemeService { | 5 | export class ThemeService { |
6 | private theme = document.querySelector('body') | 6 | private theme = document.querySelector('body') |
7 | private darkTheme = false | 7 | private darkTheme = false |
8 | private previousTheme = {} | 8 | private previousTheme: { [ id: string ]: string } = {} |
9 | 9 | ||
10 | constructor () { | 10 | constructor () { |
11 | // initialise the alternative theme with dark theme colors | 11 | // initialise the alternative theme with dark theme colors |
@@ -33,7 +33,7 @@ export class ThemeService { | |||
33 | } | 33 | } |
34 | } | 34 | } |
35 | 35 | ||
36 | private switchProperty (property, newValue?) { | 36 | private switchProperty (property: string, newValue?: string) { |
37 | const propertyOldvalue = window.getComputedStyle(this.theme).getPropertyValue('--' + property) | 37 | const propertyOldvalue = window.getComputedStyle(this.theme).getPropertyValue('--' + property) |
38 | this.theme.style.setProperty('--' + property, (newValue) ? newValue : this.previousTheme[property]) | 38 | this.theme.style.setProperty('--' + property, (newValue) ? newValue : this.previousTheme[property]) |
39 | this.previousTheme[property] = propertyOldvalue | 39 | this.previousTheme[property] = propertyOldvalue |