Skip to content

Commit

Permalink
refactor: avoid duplicated pubsub in logs
Browse files Browse the repository at this point in the history
already logged in ./src/utils/create-toggler.js,
so here we only log statud when app starts and that is all

License: MIT
Signed-off-by: Marcin Rataj <[email protected]>
  • Loading branch information
lidel committed Jan 19, 2021
1 parent 44caf74 commit 47f83cb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/enable-pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ module.exports = async function () {
try {
if (newValue === true) {
enable()
logger.info('[pubsub] enabled')
} else {
disable()
logger.info('[pubsub] disabled')
}

return true
Expand All @@ -47,9 +45,9 @@ module.exports = async function () {
return false
}
}

activate({ newValue: store.get(CONFIG_KEY, false) })
createToggler(CONFIG_KEY, activate)
logger.info(`[pubsub] ${store.get(CONFIG_KEY, false) ? 'enabled' : 'disabled'}`)
}

module.exports.CONFIG_KEY = CONFIG_KEY

0 comments on commit 47f83cb

Please sign in to comment.