1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Requested Review

This commit is contained in:
Paul Rosset
2017-12-05 18:16:42 +00:00
parent d1e5781c24
commit f4fd131100
5 changed files with 37 additions and 36 deletions

View File

@@ -32,10 +32,7 @@ class HotkeyTab extends React.Component {
message: err.message != null ? err.message : 'Error occurs!'
}})
}
if (JSON.parse(localStorage.getItem('config'))) {
const {hotkey} = JSON.parse(localStorage.getItem('config'))
this.hotkey = hotkey
}
this.oldHotkey = this.state.config.hotkey
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)
ipc.addListener('APP_SETTING_ERROR', this.handleSettingError)
}
@@ -57,7 +54,7 @@ class HotkeyTab extends React.Component {
config: newConfig
})
this.clearMessage()
this.props.haveToSave(null)
this.props.haveToSave()
}
handleHintToggleButtonClick (e) {
@@ -75,8 +72,8 @@ class HotkeyTab extends React.Component {
this.setState({
config
})
if (JSON.stringify(this.hotkey) === JSON.stringify(config.hotkey)) {
this.props.haveToSave(null)
if (JSON.stringify(this.oldHotkey) === JSON.stringify(config.hotkey)) {
this.props.haveToSave()
} else {
this.props.haveToSave({
tab: 'Hotkey',