diff --git a/src/auto-launch.js b/src/auto-launch.js index 89588efc9..b66fc964d 100644 --- a/src/auto-launch.js +++ b/src/auto-launch.js @@ -50,7 +50,7 @@ async function disable () { } module.exports = async function () { - const activate = async ({ newValue, oldValue, feedback }) => { + const activate = async ({ newValue, oldValue = null, feedback = null }) => { if (process.env.NODE_ENV === 'development') { logger.info('[launch on startup] unavailable during development') @@ -92,7 +92,7 @@ module.exports = async function () { return true } catch (err) { - logger.error(`[launch on startup] ${err.toString()}`) + logger.error(`[launch on startup] ${String(err)}`) if (feedback) { recoverableErrorDialog(err, { diff --git a/src/automatic-gc.js b/src/automatic-gc.js index 177d98e9f..82ffb6429 100644 --- a/src/automatic-gc.js +++ b/src/automatic-gc.js @@ -35,7 +35,7 @@ function applyConfig (newFlags) { } module.exports = async function () { - const activate = ({ newValue, oldValue }) => { + const activate = ({ newValue, oldValue = null }) => { if (newValue === oldValue) return try { @@ -47,7 +47,7 @@ module.exports = async function () { return true } catch (err) { - logger.error(`[automatic gc] ${err.toString()}`) + logger.error(`[automatic gc] ${String(err)}`) return false } diff --git a/src/utils/setup-global-shortcut.js b/src/utils/setup-global-shortcut.js index 19fa9ce4c..00e33badf 100644 --- a/src/utils/setup-global-shortcut.js +++ b/src/utils/setup-global-shortcut.js @@ -9,7 +9,7 @@ const ipcMainEvents = require('../common/ipc-main-events') // This function registers a global shortcut/accelerator with a certain action // and (de)activates it according to its 'settingsOption' value on settings. module.exports = function ({ settingsOption, accelerator, action, confirmationDialog }) { - const activate = ({ newValue, oldValue, feedback }) => { + const activate = ({ newValue, oldValue = null, feedback = null }) => { if (newValue === oldValue) return if (newValue === true) {