From 244b4ae3973bc1511464a08158a123767f83179c Mon Sep 17 00:00:00 2001 From: BO41 Date: Thu, 18 Oct 2018 09:08:59 +0200 Subject: NoImplicitAny flag true (#1157) this enables the `noImplicitAny` flag in the Typescript compiler > When the noImplicitAny flag is true and the TypeScript compiler cannot infer the type, it still generates the JavaScript files, but it also reports an error. Many seasoned developers prefer this stricter setting because type checking catches more unintentional errors at compile time. closes: #1131 replaces #1137 --- client/src/app/core/theme/theme.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/app/core/theme/theme.service.ts') 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' export class ThemeService { private theme = document.querySelector('body') private darkTheme = false - private previousTheme = {} + private previousTheme: { [ id: string ]: string } = {} constructor () { // initialise the alternative theme with dark theme colors @@ -33,7 +33,7 @@ export class ThemeService { } } - private switchProperty (property, newValue?) { + private switchProperty (property: string, newValue?: string) { const propertyOldvalue = window.getComputedStyle(this.theme).getPropertyValue('--' + property) this.theme.style.setProperty('--' + property, (newValue) ? newValue : this.previousTheme[property]) this.previousTheme[property] = propertyOldvalue -- cgit v1.2.3