mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Only unmount ReactEditorView's component before removing if its mounted
Fixes #3108 Unmounting the component the first time can cause a focusout event, which leads to a redundant removal and an attempt to unmount again. This protects against that.
This commit is contained in:
@@ -115,7 +115,7 @@ class ReactEditorView extends View
|
||||
@find('.lines').prepend(view)
|
||||
|
||||
beforeRemove: ->
|
||||
React.unmountComponentAtNode(@element)
|
||||
React.unmountComponentAtNode(@element) if @component.isMounted()
|
||||
@attached = false
|
||||
@trigger 'editor:detached', this
|
||||
|
||||
|
||||
Reference in New Issue
Block a user