remove post_toast_callback

This commit is contained in:
justcool393 2023-07-23 08:44:21 -05:00
parent f79c6a0dcd
commit ccebef1f06
2 changed files with 5 additions and 7 deletions

View file

@ -169,10 +169,6 @@ function post_toast3(t, url, button1, button2) {
postToastSwitch(t, url, "POST", button1, button2, "d-md-inline-block");
}
function post_toast_callback(url, data, callback) {
postToastCallback2(null, url, "POST", data, (xhr) => callback(xhr));
}
function escapeHTML(unsafe) {
return unsafe.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
}

View file

@ -34,8 +34,10 @@ function transferCoins(mobile=false) {
let transferred = amount - Math.ceil(amount*TRANSFER_TAX);
let username = document.getElementById('username').innerHTML
post_toast_callback(`/@${username}/transfer_coins`,
{"amount": document.getElementById(mobile ? "coin-transfer-amount-mobile" : "coin-transfer-amount").value},
postToastCallback2(null, `/@${username}/transfer_coins`, "POST",
{
"amount": document.getElementById(mobile ? "coin-transfer-amount-mobile" : "coin-transfer-amount").value
},
(xhr) => {
if(xhr.status == 200) {
document.getElementById("user-coins-amount").innerText = parseInt(document.getElementById("user-coins-amount").innerText) - amount;
@ -58,7 +60,7 @@ function transferBux(mobile=false) {
let amount = parseInt(document.getElementById("bux-transfer-amount").value);
let username = document.getElementById('username').innerHTML
post_toast_callback(`/@${username}/transfer_bux`,
postToastCallback2(null, `/@${username}/transfer_bux`, "POST",
{"amount": document.getElementById(mobile ? "bux-transfer-amount-mobile" : "bux-transfer-amount").value},
(xhr) => {
if(xhr.status == 200) {