diff options
Diffstat (limited to 'sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts')
-rw-r--r-- | sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts index b3b284b42..fd137fe37 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts @@ -20,6 +20,7 @@ import { IActionHandler } from '../../../../framework/src/flux/action'; import { AllAvailableLtpsLoadedAction, LoadAllAvailableLtpsAction, + SetInitialLoadedAction, } from '../actions/ltpAction'; import { LtpIds } from '../models/availableLtps'; @@ -27,11 +28,13 @@ import { LtpIds } from '../models/availableLtps'; export interface IAvailableLtpsState { distinctLtps: LtpIds[]; busy: boolean; + loadedOnce: boolean; } const ltpListStateInit: IAvailableLtpsState = { distinctLtps: [], - busy: false + busy: false, + loadedOnce: false }; export const availableLtpsActionHandler: IActionHandler<IAvailableLtpsState> = (state = ltpListStateInit, action) => { @@ -47,14 +50,22 @@ export const availableLtpsActionHandler: IActionHandler<IAvailableLtpsState> = ( state = { ...state, distinctLtps: action.availableLtps, - busy: false - }; - } else { - state = { - ...state, - busy: false + busy: false, + loadedOnce: true }; } + } else if (action instanceof SetInitialLoadedAction) { + + state = { + ...state, + loadedOnce: action.initialLoaded + }; + } else { + state = { + ...state, + busy: false + }; } + return state; };
\ No newline at end of file |