mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Remove donation amount if donation amount is $0
This commit is contained in:
@@ -770,13 +770,16 @@ function KofiShopOrder(data) {
|
|||||||
const currency = data.currency;
|
const currency = data.currency;
|
||||||
const itemTotal = data.items.length;
|
const itemTotal = data.items.length;
|
||||||
const kofiIcon = `<img src="icons/platforms/kofi.png" class="platform"/>`;
|
const kofiIcon = `<img src="icons/platforms/kofi.png" class="platform"/>`;
|
||||||
|
let formattedAmount = "";
|
||||||
|
|
||||||
let message = "";
|
if (amount == 0)
|
||||||
if (currency == "USD")
|
formattedAmount = ""
|
||||||
message = `${kofiIcon} ${user} ordered ${itemTotal} item(s) on Ko-fi ($${amount})`;
|
else if (currency == "USD")
|
||||||
|
formattedAmount = `($${amount})`;
|
||||||
else
|
else
|
||||||
message = `${kofiIcon} ${user} ordered ${itemTotal} item(s) on Ko-fi (${currency} ${amount})`;
|
formattedAmount = `(${currency} ${amount})`;
|
||||||
|
|
||||||
|
message = `${kofiIcon} ${user} ordered ${itemTotal} item(s) on Ko-fi ${formattedAmount}`;
|
||||||
ShowAlert(message, 'kofi');
|
ShowAlert(message, 'kofi');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1270,12 +1270,16 @@ function KofiShopOrder(data) {
|
|||||||
const message = data.message;
|
const message = data.message;
|
||||||
const itemTotal = data.items.length;
|
const itemTotal = data.items.length;
|
||||||
const kofiIcon = `<img src="icons/platforms/kofi.png" class="platform"/>`;
|
const kofiIcon = `<img src="icons/platforms/kofi.png" class="platform"/>`;
|
||||||
|
let formattedAmount = "";
|
||||||
|
|
||||||
if (currency == "USD")
|
if (amount == 0)
|
||||||
titleDiv.innerHTML = `${kofiIcon} ${user} ordered ${itemTotal} item(s) on Ko-fi ($${amount})`;
|
formattedAmount = ""
|
||||||
|
else if (currency == "USD")
|
||||||
|
formattedAmount = `($${amount})`;
|
||||||
else
|
else
|
||||||
titleDiv.innerHTML = `${kofiIcon} ${user} ordered ${itemTotal} item(s) on Ko-fi (${currency} ${amount})`;
|
formattedAmount = `(${currency} ${amount})`;
|
||||||
|
|
||||||
|
titleDiv.innerHTML = `${kofiIcon} ${user} ordered ${itemTotal} item(s) on Ko-fi ${formattedAmount}`;
|
||||||
if (message != null)
|
if (message != null)
|
||||||
contentDiv.innerHTML = `${message}`;
|
contentDiv.innerHTML = `${message}`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user