Skip to content

Commit 27e5010

Browse files
authored
Merge pull request #2430 from jacobherrington/hotkey-error-message-fix
Fix errors when saving a blank hotkey
2 parents efa0072 + d0171a8 commit 27e5010

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

browser/main/modals/PreferencesModal/HotkeyTab.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,20 @@ class HotkeyTab extends React.Component {
2828
}})
2929
}
3030
this.handleSettingError = (err) => {
31-
this.setState({keymapAlert: {
32-
type: 'error',
33-
message: err.message != null ? err.message : i18n.__('An error occurred!')
34-
}})
31+
if (
32+
this.state.config.hotkey.toggleMain === '' ||
33+
this.state.config.hotkey.toggleMode === ''
34+
) {
35+
this.setState({keymapAlert: {
36+
type: 'success',
37+
message: i18n.__('Successfully applied!')
38+
}})
39+
} else {
40+
this.setState({keymapAlert: {
41+
type: 'error',
42+
message: err.message != null ? err.message : i18n.__('An error occurred!')
43+
}})
44+
}
3545
}
3646
this.oldHotkey = this.state.config.hotkey
3747
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)

0 commit comments

Comments
 (0)