Refactor layout .show/.isShown to handle branch nodes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createSelector } from "reselect"
|
||||
import { normalizeArray } from "core/utils"
|
||||
import { fromJS } from "immutable"
|
||||
|
||||
const state = state => state
|
||||
|
||||
@@ -9,7 +10,7 @@ export const currentFilter = state => state.get("filter")
|
||||
|
||||
export const isShown = (state, thing, def) => {
|
||||
thing = normalizeArray(thing)
|
||||
return Boolean(state.getIn(["shown", ...thing], def))
|
||||
return state.get("shown", fromJS({})).get(fromJS(thing), def)
|
||||
}
|
||||
|
||||
export const whatMode = (state, thing, def="") => {
|
||||
@@ -21,4 +22,3 @@ export const showSummary = createSelector(
|
||||
state,
|
||||
state => !isShown(state, "editor")
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user