Merge pull request #1450 from siiky/fix/lam-609/make-notifs-actually-work

Make cash box notifications work
This commit is contained in:
Rafael Taranto 2022-11-21 21:25:52 +00:00 committed by GitHub
commit 6a3e8cb969
2 changed files with 6 additions and 8 deletions

View file

@ -92,7 +92,7 @@ const getNotifications = (cryptoCurrency, machine, config) => {
const findByMachine = _.find(_.matches({ machine })) const findByMachine = _.find(_.matches({ machine }))
const cryptoFields = ['cryptoHighBalance', 'cryptoLowBalance', 'highBalance', 'lowBalance'] const cryptoFields = ['cryptoHighBalance', 'cryptoLowBalance', 'highBalance', 'lowBalance']
const fiatFields = ['fillingPercentageCassette1', 'fillingPercentageCassette2', 'fillingPercentageCassette3', 'fillingPercentageCassette4'] const fiatFields = ['cashbox', 'fillingPercentageCassette1', 'fillingPercentageCassette2', 'fillingPercentageCassette3', 'fillingPercentageCassette4']
const getCryptoSettings = _.compose(_.pick(cryptoFields), _.defaultTo(notifications), findByCryptoCurrency) const getCryptoSettings = _.compose(_.pick(cryptoFields), _.defaultTo(notifications), findByCryptoCurrency)
const cryptoSettings = getCryptoSettings(notifications.cryptoBalanceOverrides) const cryptoSettings = getCryptoSettings(notifications.cryptoBalanceOverrides)

View file

@ -758,13 +758,11 @@ function plugins (settings, deviceId) {
const fiatCode = localeConfig.fiatCurrency const fiatCode = localeConfig.fiatCurrency
return machineLoader.getMachines() return machineLoader.getMachines()
.then(devices => { .then(devices => Promise.all([
return Promise.all([
checkCryptoBalances(fiatCode, devices), checkCryptoBalances(fiatCode, devices),
checkDevicesCashBalances(fiatCode, devices) checkDevicesCashBalances(fiatCode, devices)
]) ]))
.then(_.flow(_.flattenDeep, _.compact)) .then(_.flow(_.flattenDeep, _.compact))
})
} }
function randomCode () { function randomCode () {