mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Trigger editor:will-be-removed from SpacePen shim, not component
By the time the component is getting unmounted, we have already called remove hooks on the SpacePen shim so subscriptions to the event have been removed.
This commit is contained in:
@@ -199,7 +199,6 @@ TextEditorComponent = React.createClass
|
||||
componentWillUnmount: ->
|
||||
{editor, hostElement} = @props
|
||||
|
||||
hostElement.__spacePenView.trigger 'editor:will-be-removed', [hostElement.__spacePenView]
|
||||
@unsubscribe()
|
||||
@scopedConfigSubscriptions.dispose()
|
||||
window.removeEventListener 'resize', @requestHeightAndWidthMeasurement
|
||||
|
||||
@@ -138,6 +138,7 @@ class TextEditorView extends View
|
||||
|
||||
beforeRemove: ->
|
||||
@trigger 'editor:detached', [this]
|
||||
@trigger 'editor:will-be-removed', [this]
|
||||
@attached = false
|
||||
|
||||
remove: (selector, keepData) ->
|
||||
|
||||
Reference in New Issue
Block a user