diff --git a/src/app/Shared/Services/AuthCredentials.service.tsx b/src/app/Shared/Services/AuthCredentials.service.tsx index e207d24975..dc92cba8af 100644 --- a/src/app/Shared/Services/AuthCredentials.service.tsx +++ b/src/app/Shared/Services/AuthCredentials.service.tsx @@ -48,6 +48,7 @@ export interface Credential { export class AuthCredentials { // TODO replace with Redux? private readonly store = new Map(); + constructor(private readonly api: () => ApiService) {} setCredential(targetId: string, username: string, password: string): Observable { diff --git a/src/app/Shared/Services/Settings.service.tsx b/src/app/Shared/Services/Settings.service.tsx index 66582aa4cc..f3d7e07924 100644 --- a/src/app/Shared/Services/Settings.service.tsx +++ b/src/app/Shared/Services/Settings.service.tsx @@ -78,15 +78,6 @@ export const automatedAnalysisConfigToRecordingAttributes = ( } as RecordingAttributes; }; export class SettingsService { - constructor() { - this._featureLevel$.subscribe((featureLevel: FeatureLevel) => saveToLocalStorage('FEATURE_LEVEL', featureLevel)); - this._visibleNotificationsCount$.subscribe((count: number) => - saveToLocalStorage('VISIBLE_NOTIFICATIONS_COUNT', count) - ); - this._datetimeFormat$.subscribe((format: DatetimeFormat) => saveToLocalStorage('DATETIME_FORMAT', format)); - this._theme$.subscribe((theme: ThemeSetting) => saveToLocalStorage('THEME', theme)); - } - private readonly _featureLevel$ = new BehaviorSubject( getFromLocalStorage('FEATURE_LEVEL', FeatureLevel.PRODUCTION) ); @@ -101,6 +92,15 @@ export class SettingsService { private readonly _theme$ = new BehaviorSubject(getFromLocalStorage('THEME', ThemeSetting.AUTO)); + constructor() { + this._featureLevel$.subscribe((featureLevel: FeatureLevel) => saveToLocalStorage('FEATURE_LEVEL', featureLevel)); + this._visibleNotificationsCount$.subscribe((count: number) => + saveToLocalStorage('VISIBLE_NOTIFICATIONS_COUNT', count) + ); + this._datetimeFormat$.subscribe((format: DatetimeFormat) => saveToLocalStorage('DATETIME_FORMAT', format)); + this._theme$.subscribe((theme: ThemeSetting) => saveToLocalStorage('THEME', theme)); + } + media(query: string): Observable { const mediaQuery = window.matchMedia(query); return fromEvent(mediaQuery, 'change').pipe(startWith(mediaQuery)); diff --git a/src/app/Shared/Services/Targets.service.tsx b/src/app/Shared/Services/Targets.service.tsx index 7ccd624e7f..003cf907af 100644 --- a/src/app/Shared/Services/Targets.service.tsx +++ b/src/app/Shared/Services/Targets.service.tsx @@ -57,7 +57,7 @@ export class TargetsService { private readonly api: ApiService, private readonly notifications: Notifications, login: LoginService, - private readonly notificationChannel: NotificationChannel + notificationChannel: NotificationChannel ) { login .getSessionState() @@ -65,7 +65,7 @@ export class TargetsService { .subscribe(() => { // just trigger a startup query }); - this.notificationChannel.messages(NotificationCategory.TargetJvmDiscovery).subscribe((v) => { + notificationChannel.messages(NotificationCategory.TargetJvmDiscovery).subscribe((v) => { const evt: TargetDiscoveryEvent = v.message.event; switch (evt.kind) { case 'FOUND': diff --git a/src/index.tsx b/src/index.tsx index 86c2f3c2f7..ec3a058e54 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -35,7 +35,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - import { App } from '@app/index'; import React from 'react'; import ReactDOM from 'react-dom';