mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Merge pull request #2430 from jacobherrington/hotkey-error-message-fix
Fix errors when saving a blank hotkey
This commit is contained in:
@@ -28,10 +28,20 @@ class HotkeyTab extends React.Component {
|
|||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
this.handleSettingError = (err) => {
|
this.handleSettingError = (err) => {
|
||||||
this.setState({keymapAlert: {
|
if (
|
||||||
type: 'error',
|
this.state.config.hotkey.toggleMain === '' ||
|
||||||
message: err.message != null ? err.message : i18n.__('An error occurred!')
|
this.state.config.hotkey.toggleMode === ''
|
||||||
}})
|
) {
|
||||||
|
this.setState({keymapAlert: {
|
||||||
|
type: 'success',
|
||||||
|
message: i18n.__('Successfully applied!')
|
||||||
|
}})
|
||||||
|
} else {
|
||||||
|
this.setState({keymapAlert: {
|
||||||
|
type: 'error',
|
||||||
|
message: err.message != null ? err.message : i18n.__('An error occurred!')
|
||||||
|
}})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.oldHotkey = this.state.config.hotkey
|
this.oldHotkey = this.state.config.hotkey
|
||||||
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)
|
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)
|
||||||
|
|||||||
Reference in New Issue
Block a user