do all logging in the renderer
This commit is contained in:
@@ -57,10 +57,6 @@ function init () {
|
|||||||
|
|
||||||
ipcMain.on('blockPowerSave', blockPowerSave)
|
ipcMain.on('blockPowerSave', blockPowerSave)
|
||||||
ipcMain.on('unblockPowerSave', unblockPowerSave)
|
ipcMain.on('unblockPowerSave', unblockPowerSave)
|
||||||
|
|
||||||
ipcMain.on('log', function (e, message) {
|
|
||||||
console.log(message)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setBounds (bounds) {
|
function setBounds (bounds) {
|
||||||
|
|||||||
@@ -257,9 +257,7 @@ function jumpToTime (time) {
|
|||||||
function setupIpc () {
|
function setupIpc () {
|
||||||
ipcRenderer.send('ipcReady')
|
ipcRenderer.send('ipcReady')
|
||||||
|
|
||||||
ipcRenderer.on('dispatch', function (e, action, ...args) {
|
ipcRenderer.on('dispatch', (e, ...args) => dispatch(...args))
|
||||||
dispatch(action, ...args)
|
|
||||||
})
|
|
||||||
|
|
||||||
ipcRenderer.on('showOpenTorrentAddress', function (e) {
|
ipcRenderer.on('showOpenTorrentAddress', function (e) {
|
||||||
state.modal = 'open-torrent-address-modal'
|
state.modal = 'open-torrent-address-modal'
|
||||||
@@ -283,7 +281,7 @@ function setupIpc () {
|
|||||||
function loadState (callback) {
|
function loadState (callback) {
|
||||||
cfg.read(function (err, data) {
|
cfg.read(function (err, data) {
|
||||||
if (err) console.error(err)
|
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
|
// populate defaults if they're not there
|
||||||
state.saved = Object.assign({}, state.defaultSavedState, data)
|
state.saved = Object.assign({}, state.defaultSavedState, data)
|
||||||
@@ -305,7 +303,7 @@ function resumeTorrents () {
|
|||||||
|
|
||||||
// Write state.saved to the JSON state file
|
// Write state.saved to the JSON state file
|
||||||
function saveState () {
|
function saveState () {
|
||||||
ipcRenderer.send('log', 'saving state to ' + cfg.filePath)
|
console.log('saving state to ' + cfg.filePath)
|
||||||
cfg.write(state.saved, function (err) {
|
cfg.write(state.saved, function (err) {
|
||||||
if (err) console.error(err)
|
if (err) console.error(err)
|
||||||
update()
|
update()
|
||||||
|
|||||||
Reference in New Issue
Block a user