state: Use dispatch instead of direct call
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
const State = require('../lib/state')
|
||||
const {dispatch} = require('../lib/dispatcher')
|
||||
const ipcRenderer = require('electron').ipcRenderer
|
||||
|
||||
@@ -56,7 +55,7 @@ module.exports = class PrefsController {
|
||||
ipcRenderer.send('setStartup', state.unsaved.prefs.startup)
|
||||
}
|
||||
state.saved.prefs = Object.assign(state.saved.prefs || {}, state.unsaved.prefs)
|
||||
State.save(state)
|
||||
dispatch('saveState')
|
||||
dispatch('checkDownloadPath')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ const electron = require('electron')
|
||||
|
||||
const {dispatch} = require('../lib/dispatcher')
|
||||
const {TorrentKeyNotFoundError} = require('../lib/errors')
|
||||
const State = require('../lib/state')
|
||||
const sound = require('../lib/sound')
|
||||
const TorrentSummary = require('../lib/torrent-summary')
|
||||
|
||||
@@ -159,7 +158,7 @@ module.exports = class TorrentListController {
|
||||
|
||||
// remove torrent from saved list
|
||||
this.state.saved.torrents.splice(index, 1)
|
||||
State.saveThrottled(this.state)
|
||||
dispatch('saveStateThrottled')
|
||||
}
|
||||
|
||||
// prevent user from going forward to a deleted torrent
|
||||
|
||||
Reference in New Issue
Block a user