mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
fix(prefs): atom.keymaps
does not implement unsubscribe
https://github.com/atom/atom-keymap/issues/101
This commit is contained in:
parent
c8f1da0358
commit
683ef61c1f
|
@ -25,11 +25,14 @@ class PreferencesKeymaps extends React.Component
|
|||
@_loadTemplates()
|
||||
|
||||
componentDidMount: =>
|
||||
@unsubscribe = atom.keymaps.onDidReloadKeymap =>
|
||||
@_mounted = true
|
||||
atom.keymaps.onDidReloadKeymap =>
|
||||
# Temporary fix for https://github.com/atom/atom-keymap/issues/101
|
||||
return unless @_mounted
|
||||
@setState(bindings: @_getStateFromKeymaps())
|
||||
|
||||
componentWillUnmount: =>
|
||||
@unsubscribe?()
|
||||
@_mounted = false
|
||||
|
||||
_loadTemplates: =>
|
||||
templatesDir = path.join(atom.getLoadSettings().resourcePath, 'keymaps', 'templates')
|
||||
|
|
Loading…
Reference in a new issue