More refactoring

This commit is contained in:
Willem Dantuma
2020-03-02 08:55:11 +01:00
parent a151b73d03
commit da1c9c3fe2
3 changed files with 30 additions and 33 deletions

View File

@@ -181,9 +181,9 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
let a = action as mapActions.SelectTemporalItemsSuccess;
let selectedItemLayer=tassign(state.selectedItemLayer) as TemporalItemLayer;
selectedItemLayer.temporalItems = a.temporalItems;
selectedItemLayer.selectedItem = a.temporalItems.length>0?a.temporalItems[a.temporalItems.length-1]:null;
selectedItemLayer.previousItem = a.temporalItems.length>1?a.temporalItems[a.temporalItems.length-2]:null;
selectedItemLayer.nextItem = null;
selectedItemLayer.selectedItemLayer = a.temporalItems.length>0?new ItemLayer(a.temporalItems[a.temporalItems.length-1]):null;
selectedItemLayer.previousItemLayer = a.temporalItems.length>1?new ItemLayer(a.temporalItems[a.temporalItems.length-2]):null;
selectedItemLayer.nextItemLayer = null;
return tassign(state,{selectedItemLayer:tassign(state.selectedItemLayer,selectedItemLayer as ItemLayer)});
}
case mapActions.STARTSEARCH: {