Skip to content

Commit dac97fc

Browse files
committed
Only use .toJS if markers is immutable
1 parent 9f3586f commit dac97fc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/plugins/editor/components/editor.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,12 @@ export default function makeEditor({ editorPluginsToRun }) {
134134

135135
// FIXME: this is a hacky solution.
136136
// we should find a way to wait until the spec has been loaded into ACE.
137-
if(force === true || (this.props.specId !== nextProps.specId || !Im.is(nextProps.markers, this.props.markers))) {
137+
if(force === true || this.props.specId !== nextProps.specId || !Im.is(this.props.markers, nextProps.markers)) {
138+
const markers = Im.Map.isMap(nextProps.markers) ? nextProps.markers.toJS() : {}
138139
setTimeout(placeMarkerDecorations.bind(null, {
139140
editor: state.editor,
140-
markers: nextProps.markers.toJS(),
141-
onMarkerLineUpdate
141+
markers,
142+
onMarkerLineUpdate,
142143
}), 300)
143144
}
144145
}

0 commit comments

Comments
 (0)