Don't forceUpdate in setImmediate callback if editor is unmounted

This was throwing errors in the EditorComponent spec.

/cc @benogle, just so you're aware
This commit is contained in:
Nathan Sobo
2014-06-11 07:21:05 -06:00
parent 7040906473
commit 5add0e4f70

View File

@@ -533,7 +533,7 @@ EditorComponent = React.createClass
onDecorationChanged: ->
@decorationChangedImmediate ?= setImmediate =>
@requestUpdate()
@requestUpdate() if @isMounted()
@decorationChangedImmediate = null
selectToMousePositionUntilMouseUp: (event) ->