mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-08 21:55:54 +08:00
fix(prefs): atom.keymaps
does not implement unsubscribe
https://github.com/atom/atom-keymap/issues/101
This commit is contained in:
parent
0650768788
commit
08db4679aa
1 changed files with 5 additions and 2 deletions
|
@ -25,11 +25,14 @@ class PreferencesKeymaps extends React.Component
|
||||||
@_loadTemplates()
|
@_loadTemplates()
|
||||||
|
|
||||||
componentDidMount: =>
|
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())
|
@setState(bindings: @_getStateFromKeymaps())
|
||||||
|
|
||||||
componentWillUnmount: =>
|
componentWillUnmount: =>
|
||||||
@unsubscribe?()
|
@_mounted = false
|
||||||
|
|
||||||
_loadTemplates: =>
|
_loadTemplates: =>
|
||||||
templatesDir = path.join(atom.getLoadSettings().resourcePath, 'keymaps', 'templates')
|
templatesDir = path.join(atom.getLoadSettings().resourcePath, 'keymaps', 'templates')
|
||||||
|
|
Loading…
Add table
Reference in a new issue