Pref: default torrent file handler

Before, the app made itself the default torrent file handler automatically, pissing off some of our users. Now, it's not by default, and you can change it in the prefs.
This commit is contained in:
DC
2016-08-10 02:21:10 -07:00
parent 11eb603930
commit 8233faf518
5 changed files with 77 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
const {dispatch} = require('../lib/dispatcher')
const State = require('../lib/state')
const ipcRenderer = require('electron').ipcRenderer
// Controls the Preferences screen
module.exports = class PrefsController {
@@ -41,6 +42,9 @@ module.exports = class PrefsController {
// All unsaved prefs take effect atomically, and are saved to config.json
save () {
var state = this.state
if (state.unsaved.prefs.isFileHandler !== state.saved.prefs.isFileHandler) {
ipcRenderer.send('setDefaultFileHandler', state.unsaved.prefs.isFileHandler)
}
state.saved.prefs = Object.assign(state.saved.prefs || {}, state.unsaved.prefs)
State.save(state)
}