File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/plugins/editor/components Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React, { PropTypes } from "react"
22import AceEditor from "react-ace"
33import editorPluginsHook from "../editor-plugins/hook"
44import { placeMarkerDecorations } from "../editor-helpers/marker-placer"
5- import { fromJS } from "immutable"
5+ import Im , { fromJS } from "immutable"
66import ImPropTypes from "react-immutable-proptypes"
77
88import eq from "lodash/eq"
@@ -132,15 +132,14 @@ export default function makeEditor({ editorPluginsToRun }) {
132132 let { state } = this
133133 let { onMarkerLineUpdate } = nextProps
134134
135- let size = obj => Object . keys ( obj ) . length
136-
137135 // FIXME: this is a hacky solution.
138136 // we should find a way to wait until the spec has been loaded into ACE.
139- if ( force === true || ( this . props . specId !== nextProps . specId || size ( this . props . markers ) !== size ( nextProps . 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 ( ) : { }
140139 setTimeout ( placeMarkerDecorations . bind ( null , {
141140 editor : state . editor ,
142- markers : nextProps . markers ,
143- onMarkerLineUpdate
141+ markers,
142+ onMarkerLineUpdate,
144143 } ) , 300 )
145144 }
146145 }
You can’t perform that action at this time.
0 commit comments