Prevent erroneously setting state outside of settings window

This commit is contained in:
Andrew Morgan 2019-03-07 16:26:53 +00:00
parent 012ad9ef56
commit 94b6396e0c
1 changed files with 6 additions and 2 deletions

View File

@ -265,8 +265,12 @@ export default class ElectronPlatform extends VectorBasePlatform {
ipcRenderer.send('stop-listening-keys');
}
onKeypress(self: any, callback: (ev, event) => void ) {
ipcRenderer.on('keypress', callback.bind(self));
onKeypress(self: any, callback: (ev, event) => void) {
ipcRenderer.on('keypress', callback);
}
removeOnKeypress(self: any, callback: (ev, event) => void) {
ipcRenderer.removeListener('keypress', callback);
}
onWindowBlurred(callback: () => void) {