Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Revert "Handle prefs callbacks by key and value"
Browse files Browse the repository at this point in the history
This reverts commit 17bbf81.
  • Loading branch information
bbondy committed Aug 10, 2016
1 parent 314751e commit c84e656
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
35 changes: 15 additions & 20 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,28 +410,23 @@ app.on('ready', () => {
app.quit()
})

ipcMain.on(messages.PREFS_RESTART, (config, value) => {
ipcMain.on(messages.PREFS_RESTART, () => {
var message = locale.translation('prefsRestart')

if (prefsRestartCallbacks[config + value]) {
delete prefsRestartCallbacks[config + value]
appActions.hideMessageBox(message)
} else {
appActions.showMessageBox({
buttons: [locale.translation('yes'), locale.translation('no')],
options: {
persist: false
},
message
})
prefsRestartCallbacks[config + value] = (buttonIndex, persist) => {
delete prefsRestartCallbacks[config + value]
if (buttonIndex === 0) {
app.relaunch({args: process.argv.slice(1) + ['--relaunch']})
app.quit()
} else {
appActions.hideMessageBox(message)
}
appActions.showMessageBox({
buttons: [locale.translation('yes'), locale.translation('no')],
options: {
persist: false
},
message
})
prefsRestartCallbacks[message] = (buttonIndex, persist) => {
delete prefsRestartCallbacks[message]
if (buttonIndex === 0) {
app.relaunch({args: process.argv.slice(1) + ['--relaunch']})
app.quit()
} else {
appActions.hideMessageBox(message)
}
}
})
Expand Down
4 changes: 2 additions & 2 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class SecurityTab extends ImmutableComponent {
}
onToggleFlash (e) {
aboutActions.setResourceEnabled(flash, e.target.value)
ipc.send(messages.PREFS_RESTART, flash, e.target.value)
ipc.send(messages.PREFS_RESTART)
}
render () {
const lastPassPreferencesUrl = ('chrome-extension://' + extensionIds[passwordManagers.LAST_PASS] + '/tabDialog.html?dialog=preferences&cmd=open')
Expand Down Expand Up @@ -685,7 +685,7 @@ class AboutPreferences extends React.Component {
aboutActions.changeSetting(key, value)
if (key === settings.DO_NOT_TRACK || key === settings.HARDWARE_ACCELERATION_ENABLED ||
key === settings.PDFJS_ENABLED || key === settings.SMOOTH_SCROLL_ENABLED) {
ipc.send(messages.PREFS_RESTART, key, value)
ipc.send(messages.PREFS_RESTART)
}
}

Expand Down

0 comments on commit c84e656

Please sign in to comment.