diff --git a/src/services/state/userConfigState.store.ts b/src/services/state/userConfigState.store.ts index da025161c078f6b5d6c3af8e0f620fa0d00f6124..db913779d0148b5f7bbc8bddbc09dfe5431de1cd 100644 --- a/src/services/state/userConfigState.store.ts +++ b/src/services/state/userConfigState.store.ts @@ -12,7 +12,7 @@ import { NEWVIEWER, SELECT_PARCELLATION, SELECT_REGIONS } from "./viewerState.st // TODO file bug and reverse import * as viewerConfigStore from './viewerConfig.store' -const SET_MOBILE_UI = viewerConfigStore.ACTION_TYPES.SET_MOBILE_UI +const SET_MOBILE_UI = viewerConfigStore.VIEWER_CONFIG_ACTION_TYPES.SET_MOBILE_UI export interface StateInterface { savedRegionsSelection: RegionSelection[] diff --git a/src/services/state/viewerConfig.store.ts b/src/services/state/viewerConfig.store.ts index b3f32ec8b264eef4785537830284a74d21de5fb1..5df3cfdcba9ebfcfea66f43a5787122729a562da 100644 --- a/src/services/state/viewerConfig.store.ts +++ b/src/services/state/viewerConfig.store.ts @@ -22,7 +22,7 @@ export const CONFIG_CONSTANTS = { defaultAnimation: true, } -export const ACTION_TYPES = { +export const VIEWER_CONFIG_ACTION_TYPES = { SET_ANIMATION: `SET_ANIMATION`, UPDATE_CONFIG: `UPDATE_CONFIG`, CHANGE_GPU_LIMIT: `CHANGE_GPU_LIMIT`, @@ -63,7 +63,7 @@ export const defaultState: StateInterface = { export const getStateStore = ({ state = defaultState } = {}) => (prevState: StateInterface = state, action: ViewerConfigurationAction) => { switch (action.type) { - case ACTION_TYPES.SET_MOBILE_UI: { + case VIEWER_CONFIG_ACTION_TYPES.SET_MOBILE_UI: { const { payload } = action const { useMobileUI } = payload return { @@ -71,12 +71,12 @@ export const getStateStore = ({ state = defaultState } = {}) => (prevState: Stat useMobileUI, } } - case ACTION_TYPES.UPDATE_CONFIG: + case VIEWER_CONFIG_ACTION_TYPES.UPDATE_CONFIG: return { ...prevState, ...action.config, } - case ACTION_TYPES.CHANGE_GPU_LIMIT: { + case VIEWER_CONFIG_ACTION_TYPES.CHANGE_GPU_LIMIT: { const newGpuLimit = Math.min( CONFIG_CONSTANTS.gpuLimitMax, Math.max( diff --git a/src/ui/config/config.component.ts b/src/ui/config/config.component.ts index d734ed7320c932a2afef6eea91b5dddcda784829..221a79337d487e24eb863c5c9d9fc27e7bd85bba 100644 --- a/src/ui/config/config.component.ts +++ b/src/ui/config/config.component.ts @@ -5,7 +5,7 @@ import { combineLatest, Observable, Subscription } from 'rxjs'; import { debounceTime, distinctUntilChanged, map, startWith } from 'rxjs/operators'; import { AtlasViewerConstantsServices } from 'src/atlasViewer/atlasViewer.constantService.service'; import { NG_VIEWER_ACTION_TYPES, SUPPORTED_PANEL_MODES } from 'src/services/state/ngViewerState.store'; -import { ACTION_TYPES as VIEWER_CONFIG_ACTION_TYPES, StateInterface as ViewerConfiguration } from 'src/services/state/viewerConfig.store' +import { VIEWER_CONFIG_ACTION_TYPES, StateInterface as ViewerConfiguration } from 'src/services/state/viewerConfig.store' import { IavRootStoreInterface } from 'src/services/stateStore.service'; import { isIdentityQuat } from '../nehubaContainer/util'; diff --git a/src/ui/nehubaContainer/nehubaContainer.component.ts b/src/ui/nehubaContainer/nehubaContainer.component.ts index ac50c13fb5ad1a4c411caa6cae0f6d8b77b9aa95..1c0935bda9d33a2c5b4ebb24a68867300f1c5b44 100644 --- a/src/ui/nehubaContainer/nehubaContainer.component.ts +++ b/src/ui/nehubaContainer/nehubaContainer.component.ts @@ -155,8 +155,6 @@ export class NehubaContainer implements OnInit, OnChanges, OnDestroy { private log: LoggingService, ) { - this.exportNehuba = getExportNehuba() - this.useMobileUI$ = this.constantService.useMobileUI$ this.viewerPerformanceConfig$ = this.store.pipe( @@ -345,7 +343,13 @@ export class NehubaContainer implements OnInit, OnChanges, OnDestroy { private findPanelIndex = (panel: HTMLElement) => this.viewPanels.findIndex(p => p === panel) - private exportNehuba: any + private _exportNehuba: any + get exportNehuba() { + if (!this._exportNehuba) { + this._exportNehuba = getExportNehuba() + } + return this._exportNehuba + } public ngOnInit() {