Skip to content
Snippets Groups Projects
Commit cd911fa5 authored by Xiao Gui's avatar Xiao Gui
Browse files

fix lint

parent 4f464ed8
No related branches found
No related tags found
No related merge requests found
......@@ -107,12 +107,13 @@ export const getStateStore = ({ state = defaultState } = {}) => (prevState: Stat
layers: prevState.layers.filter(l => !layerNameSet.has(l.name)),
}
}
case REMOVE_NG_LAYER:
case REMOVE_NG_LAYER: {
return {
...prevState,
layers : prevState.layers.filter(l => l.name !== action.layer.name),
}
case SHOW_NG_LAYER:
}
case SHOW_NG_LAYER:
return {
...prevState,
layers : prevState.layers.map(l => l.name === action.layer.name
......@@ -132,72 +133,18 @@ export const getStateStore = ({ state = defaultState } = {}) => (prevState: Stat
...prevState,
forceShowSegment : action.forceShowSegment,
}
case ADD_NG_LAYER:
return {
...prevState,
/* this configration hides the layer if a non mixable layer already present */
/* this configuration does not the addition of multiple non mixable layers */
// layers : action.layer.mixability === 'nonmixable' && prevState.layers.findIndex(l => l.mixability === 'nonmixable') >= 0
// ? prevState.layers
// : prevState.layers.concat(action.layer)
/* this configuration allows the addition of multiple non mixables */
// layers : prevState.layers.map(l => mapLayer(l, action.layer)).concat(action.layer)
layers : mixNgLayers(prevState.layers, action.layer)
// action.layer.constructor === Array
// ? prevState.layers.concat(action.layer)
// : prevState.layers.concat({
// ...action.layer,
// ...( action.layer.mixability === 'nonmixable' && prevState.layers.findIndex(l => l.mixability === 'nonmixable') >= 0
// ? {visible: false}
// : {})
// })
}
case REMOVE_NG_LAYERS:
const { layers } = action
const layerNameSet = new Set(layers.map(l => l.name))
return {
...prevState,
layers: prevState.layers.filter(l => !layerNameSet.has(l.name))
}
case REMOVE_NG_LAYER:
return {
...prevState,
layers : prevState.layers.filter(l => l.name !== action.layer.name)
}
case SHOW_NG_LAYER:
return {
...prevState,
layers : prevState.layers.map(l => l.name === action.layer.name
? { ...l, visible: true }
: l)
}
case HIDE_NG_LAYER:
return {
...prevState,
layers : prevState.layers.map(l => l.name === action.layer.name
? { ...l, visible: false }
: l)
}
case FORCE_SHOW_SEGMENT:
return {
...prevState,
forceShowSegment : action.forceShowSegment
}
case NEHUBA_READY:
const { nehubaReady } = action
return {
...prevState,
nehubaReady
}
case GENERAL_ACTION_TYPES.APPLY_STATE:
const { ngViewerState } = (action as any).state
return ngViewerState
default: return prevState
case NEHUBA_READY: {
const { nehubaReady } = action
return {
...prevState,
nehubaReady
}
}
case GENERAL_ACTION_TYPES.APPLY_STATE: {
const { ngViewerState } = (action as any).state
return ngViewerState
}
default: return prevState
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment