Fix for when 'layout.visibility' is undefined

This commit is contained in:
orangemug 2018-06-03 09:31:02 +01:00
parent b116eef147
commit 32edb48e16

View file

@ -209,6 +209,7 @@ export default class LayerEditor extends React.Component {
</LayerEditorGroup> </LayerEditorGroup>
}) })
const layout = this.props.layer.layout || {}
const items = { const items = {
delete: { delete: {
@ -220,7 +221,7 @@ export default class LayerEditor extends React.Component {
handler: () => this.props.onLayerCopy(this.props.layer.id) handler: () => this.props.onLayerCopy(this.props.layer.id)
}, },
hide: { hide: {
text: (this.props.layer.layout.visibility === "visible") ? "Hide" : "Show", text: (layout.visibility === "none") ? "Show" : "Hide",
handler: () => this.props.onLayerVisibilityToggle(this.props.layer.id) handler: () => this.props.onLayerVisibilityToggle(this.props.layer.id)
}, },
moveLayerUp: { moveLayerUp: {