MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / getCardPoolResolvedStatus

Function getCardPoolResolvedStatus

static/js/payment.js:1698–1711  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

1696}
1697
1698function getCardPoolResolvedStatus(item) {
1699 if (!item) return "used";
1700 const rawStatus = String(item.status || "").trim().toLowerCase();
1701 if (rawStatus === "used") return "used";
1702 const expiresRaw = String(item.expires_at || "").trim();
1703 if (expiresRaw) {
1704 const expiresAt = Date.parse(expiresRaw);
1705 if (Number.isFinite(expiresAt) && expiresAt <= Date.now()) {
1706 return "expired";
1707 }
1708 }
1709 if (rawStatus === "expired") return "expired";
1710 return "unused";
1711}
1712
1713function loadCardPoolRedeemCodes() {
1714 const parsed = safeJsonParse(localStorage.getItem(CARD_POOL_REDEEM_STORAGE_KEY) || "[]", []);

Callers 1

loadCardPoolRedeemCodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected