do all logging in the renderer

This commit is contained in:
Feross Aboukhadijeh
2016-03-19 19:40:22 -07:00
parent afe5151e28
commit 81bb8eea7b
2 changed files with 3 additions and 9 deletions

View File

@@ -257,9 +257,7 @@ function jumpToTime (time) {
function setupIpc () {
ipcRenderer.send('ipcReady')
ipcRenderer.on('dispatch', function (e, action, ...args) {
dispatch(action, ...args)
})
ipcRenderer.on('dispatch', (e, ...args) => dispatch(...args))
ipcRenderer.on('showOpenTorrentAddress', function (e) {
state.modal = 'open-torrent-address-modal'
@@ -283,7 +281,7 @@ function setupIpc () {
function loadState (callback) {
cfg.read(function (err, data) {
if (err) console.error(err)
ipcRenderer.send('log', 'loaded state from ' + cfg.filePath)
console.log('loaded state from ' + cfg.filePath)
// populate defaults if they're not there
state.saved = Object.assign({}, state.defaultSavedState, data)
@@ -305,7 +303,7 @@ function resumeTorrents () {
// Write state.saved to the JSON state file
function saveState () {
ipcRenderer.send('log', 'saving state to ' + cfg.filePath)
console.log('saving state to ' + cfg.filePath)
cfg.write(state.saved, function (err) {
if (err) console.error(err)
update()