Keymaps are now updated without restarting (#2455)
* Reload keymaps without restarting * Reattach key listeners when config have changed
This commit is contained in:
parent
319ff3bcd7
commit
81709073cf
6 changed files with 37 additions and 25 deletions
|
|
@ -20,6 +20,9 @@ class Hyper extends PureComponent {
|
|||
this.handleFocusActive = this.handleFocusActive.bind(this);
|
||||
this.onTermsRef = this.onTermsRef.bind(this);
|
||||
this.mousetrap = null;
|
||||
this.state = {
|
||||
lastConfigUpdate: 0
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(next) {
|
||||
|
|
@ -28,6 +31,11 @@ class Hyper extends PureComponent {
|
|||
// starts working again
|
||||
document.body.style.backgroundColor = next.backgroundColor;
|
||||
}
|
||||
const {lastConfigUpdate} = next;
|
||||
if (lastConfigUpdate && lastConfigUpdate !== this.state.lastConfigUpdate) {
|
||||
this.setState({lastConfigUpdate});
|
||||
this.attachKeyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
handleFocusActive() {
|
||||
|
|
@ -132,7 +140,8 @@ const HyperContainer = connect(
|
|||
borderColor: state.ui.borderColor,
|
||||
activeSession: state.sessions.activeUid,
|
||||
backgroundColor: state.ui.backgroundColor,
|
||||
maximized: state.ui.maximized
|
||||
maximized: state.ui.maximized,
|
||||
lastConfigUpdate: state.ui._lastUpdate
|
||||
};
|
||||
},
|
||||
dispatch => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue