fix(message-toolbar): Handle scenario where toolbar items rapidly removed (Sentry 2861)

This commit is contained in:
Ben Gotow 2015-09-09 15:27:42 -07:00
parent ac9a86e6f3
commit 5535ec43d1

View file

@ -33,6 +33,7 @@ class MessageToolbarItems extends React.Component
@_unsubscribers.push FocusedContentStore.listen @_onChange @_unsubscribers.push FocusedContentStore.listen @_onChange
componentWillUnmount: => componentWillUnmount: =>
return unless @_unsubscribers
unsubscribe() for unsubscribe in @_unsubscribers unsubscribe() for unsubscribe in @_unsubscribers
_onChange: => _onChange: =>