Fix: unhandled rejection, notif center settings not being respected
This commit is contained in:
parent
f0afbf0137
commit
61fec80899
2 changed files with 10 additions and 3 deletions
|
|
@ -207,11 +207,11 @@ function sendTransactionMessage (rec, isHighValueTx) {
|
|||
// for notification center, check if type of notification is active before calling the respective notify function
|
||||
const notifyIfActive = (type, fnName, ...args) => {
|
||||
return settingsLoader.loadLatest().then(settings => {
|
||||
const notificationSettings = configManager.getGlobalNotifications(settings.config).notificationCenter
|
||||
const notificationSettings = utils.fromNamespace('notificationCenter', configManager.getGlobalNotifications(settings.config))
|
||||
if (!notificationCenter[fnName]) return Promise.reject(new Error(`Notification function ${fnName} for type ${type} does not exist`))
|
||||
if (!(notificationSettings.active && notificationSettings[type])) return Promise.resolve()
|
||||
return notificationCenter[fnName](...args)
|
||||
})
|
||||
}).catch(console.error)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue