fix recharge reward duration labels

This commit is contained in:
zhx 2026-05-26 20:53:04 +08:00
parent 4b47da1674
commit f888682c13

View File

@ -968,11 +968,11 @@
function rewardLabel(item) {
if (!item) return "";
if (item.kind === "gold") return formatCompact(item.amount || 0);
var name = trimValue(item.name) || trimValue(item.content) || trimValue(item.type);
var quantity = Number(item.quantity || 0);
if (name && quantity > 1) return name + " x" + formatCompact(quantity);
if (Number.isFinite(quantity) && quantity > 0) return formatCompact(quantity) + " Days";
var name = trimValue(item.name) || trimValue(item.content) || trimValue(item.type);
if (name) return name;
return quantity > 0 ? "x" + formatCompact(quantity) : "";
return "";
}
function levelRewards(level) {