Skip to content

Commit

Permalink
Update donation.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nicnacnic authored Jul 13, 2022
1 parent 45a72fa commit 59197a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions graphics/helpers/donation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ let countUp;

NodeCG.waitForReplicants(data).then(() => {

data.on('change', (newVal) => handleCountUp(newVal.event.total));
data.on('change', (newVal) => handleCountUp(newVal.event.total, newVal.event.currency));

function handleCountUp(amount) {
function handleCountUp(amount, currency) {
if (!countUp) {
countUp = new CountUp('donationTotal', amount, amount, 0, 0.75, {
prefix: '$'
prefix: currency,
});
countUp.start();
} else countUp.update(amount);
}
});
});

0 comments on commit 59197a1

Please sign in to comment.