Skip to content

Commit

Permalink
various: Fix missing await on some configuration values
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Apr 7, 2018
1 parent 93ec8ca commit 7f10277
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion libs/integrations/donationalerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Donationalerts {
})
global.events.fire('tip', { username: data.username.toLowerCase(), amount: data.amount, message: data.message, currency: data.currency })
global.db.engine.insert('users.tips', { username: data.username.toLowerCase(), amount: data.amount, message: data.message, currency: data.currency, timestamp: _.now() })
if (await global.cache.isOnline()) global.api.current.tips = global.api.current.tips + parseFloat(global.currency.exchange(data.amount, data.currency, global.configuration.getValue('currency')))
if (await global.cache.isOnline()) global.api.current.tips = global.api.current.tips + parseFloat(global.currency.exchange(data.amount, data.currency, await global.configuration.getValue('currency')))
})
}
sockets () {
Expand Down
2 changes: 1 addition & 1 deletion libs/integrations/streamlabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Streamlabs {
})
global.events.fire('tip', { username: event.from.toLowerCase(), amount: event.amount, message: event.message, currency: event.currency })
global.db.engine.insert('users.tips', { username: event.from.toLowerCase(), amount: event.amount, message: event.message, currency: event.currency, timestamp: _.now() })
if (await global.cache.isOnline()) global.api.current.tips = global.api.current.tips + parseFloat(global.currency.exchange(event.amount, event.currency, global.configuration.getValue('currency')))
if (await global.cache.isOnline()) global.api.current.tips = global.api.current.tips + parseFloat(global.currency.exchange(event.amount, event.currency, await global.configuration.getValue('currency')))
}
}
})
Expand Down
16 changes: 8 additions & 8 deletions libs/overlays/alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ Alerts.prototype.commands = function () {
]
}

Alerts.prototype.replay = function (self, socket, data) {
Alerts.prototype.replay = async function (self, socket, data) {
const replay = [
'type=video',
'url=' + data,
'position=' + global.configuration.getValue('replayPosition'),
'x-offset=' + global.configuration.getValue('replayOffsetX'),
'y-offset=' + global.configuration.getValue('replayOffsetY'),
'size=' + global.configuration.getValue('replaySize'),
'volume=' + global.configuration.getValue('replayVolume'),
'label=' + global.configuration.getValue('replayLabel'),
'filter=' + global.configuration.getValue('replayFilter'),
'position=' + await global.configuration.getValue('replayPosition'),
'x-offset=' + await global.configuration.getValue('replayOffsetX'),
'y-offset=' + await global.configuration.getValue('replayOffsetY'),
'size=' + await global.configuration.getValue('replaySize'),
'volume=' + await global.configuration.getValue('replayVolume'),
'label=' + await global.configuration.getValue('replayLabel'),
'filter=' + await global.configuration.getValue('replayFilter'),
'class=replay'
]
self.overlay(self, null, replay.join(' '))
Expand Down
4 changes: 2 additions & 2 deletions libs/systems/points.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ Points.prototype.startCounting = function (username) {
}

Points.prototype.updatePoints = async function () {
var interval = (await global.cache.isOnline() ? global.configuration.getValue('pointsInterval') * 60 * 1000 : await global.configuration.getValue('pointsIntervalOffline') * 60 * 1000)
var ptsPerInterval = (await global.cache.isOnline() ? global.configuration.getValue('pointsPerInterval') : await global.configuration.getValue('pointsPerIntervalOffline'))
var interval = (await global.cache.isOnline() ? await global.configuration.getValue('pointsInterval') * 60 * 1000 : await global.configuration.getValue('pointsIntervalOffline') * 60 * 1000)
var ptsPerInterval = (await global.cache.isOnline() ? await global.configuration.getValue('pointsPerInterval') : await global.configuration.getValue('pointsPerIntervalOffline'))

let users = await global.users.getAll({ is: { online: true } })
for (let user of users) {
Expand Down

0 comments on commit 7f10277

Please sign in to comment.