update currency values when buying awards from the award modal
parent
2738ae8db7
commit
1c2e865495
|
@ -91,7 +91,11 @@ function vote(type, id, dir) {
|
||||||
xhr[0].send(xhr[1]);
|
xhr[0].send(xhr[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let global_price;
|
||||||
|
|
||||||
function pick(kind, price, coins, marseybux) {
|
function pick(kind, price, coins, marseybux) {
|
||||||
|
global_price = price;
|
||||||
|
|
||||||
price = parseInt(price)
|
price = parseInt(price)
|
||||||
coins = parseInt(coins)
|
coins = parseInt(coins)
|
||||||
marseybux = parseInt(marseybux)
|
marseybux = parseInt(marseybux)
|
||||||
|
@ -146,6 +150,9 @@ function buy(mb) {
|
||||||
let ownednum = Number(owned.textContent) + 1;
|
let ownednum = Number(owned.textContent) + 1;
|
||||||
owned.textContent = ownednum
|
owned.textContent = ownednum
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const currency = mb ? "bux" : "coins";
|
||||||
|
document.getElementById(`user-${currency}-amount`).innerText = parseInt(document.getElementById(`user-${currency}-amount`).innerText) - global_price;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue