Feat: enable notify operator for OFAC matches

Fix: fix lack of newline in some SVGs

Chore: fix rebase issues
This commit is contained in:
Cesar 2021-01-21 17:04:02 +00:00 committed by Josh Harvey
parent 69d3e4cb9b
commit 05373e83db
6 changed files with 46 additions and 40 deletions

View file

@ -136,8 +136,8 @@ function transactionNotify (tx, rec) {
const isCashOut = tx.direction === 'cashOut'
// for notification center
const directionDisplay = tx.direction === 'cashOut' ? 'cash-out' : 'cash-in'
const readyToNotify = tx.direction === 'cashIn' || (tx.direction === 'cashOut' && rec.isRedemption)
const directionDisplay = isCashOut ? 'cash-out' : 'cash-in'
const readyToNotify = !isCashOut || (tx.direction === 'cashOut' && rec.isRedemption)
// awaiting for redesign. notification should not be sent if toggle in the settings table is disabled,
// but currently we're sending notifications of high value tx even with the toggle disabled
if (readyToNotify && !highValueTx) {
@ -204,21 +204,13 @@ function sendTransactionMessage (rec, isHighValueTx) {
})
}
const notificationCenterFunctions = {
'customerComplianceNotify': notificationCenter.customerComplianceNotify,
'blacklistNotify': notificationCenter.blacklistNotify,
'balancesNotify': notificationCenter.balancesNotify,
'errorAlertsNotify': notificationCenter.errorAlertsNotify,
'notifCenterTransactionNotify': notificationCenter.notifCenterTransactionNotify
}
// 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
if (!notificationCenterFunctions[fnName]) return Promise.reject(new Error(`Notification function ${fnName} for type ${type} does not exist`))
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 notificationCenterFunctions[fnName](...args)
return notificationCenter[fnName](...args)
})
}