undo(prefs): atom.keymaps does not implement unsubscribe

This commit is contained in:
Ben Gotow 2015-11-11 10:20:48 -08:00
parent 683ef61c1f
commit d28e84d95a

View file

@ -25,14 +25,11 @@ class PreferencesKeymaps extends React.Component
@_loadTemplates() @_loadTemplates()
componentDidMount: => componentDidMount: =>
@_mounted = true @_disposable = atom.keymaps.onDidReloadKeymap =>
atom.keymaps.onDidReloadKeymap =>
# Temporary fix for https://github.com/atom/atom-keymap/issues/101
return unless @_mounted
@setState(bindings: @_getStateFromKeymaps()) @setState(bindings: @_getStateFromKeymaps())
componentWillUnmount: => componentWillUnmount: =>
@_mounted = false @_disposable.dispose()
_loadTemplates: => _loadTemplates: =>
templatesDir = path.join(atom.getLoadSettings().resourcePath, 'keymaps', 'templates') templatesDir = path.join(atom.getLoadSettings().resourcePath, 'keymaps', 'templates')