Refuel income: a reported 0 credits (house-ad visit) stays 0, never falls back to the visit price
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -51,7 +51,8 @@ function poolAdd(field, pol) { store.update('pool', {}, p => { p[field] = r4((p[
|
|||||||
// ---- refuels: the income --------------------------------------------------------------------
|
// ---- refuels: the income --------------------------------------------------------------------
|
||||||
async function refuel(me, info) {
|
async function refuel(me, info) {
|
||||||
const s = settings();
|
const s = settings();
|
||||||
const credits = Math.max(0, Number(info.credits) || Number(s.creditsPerVisit) || 3);
|
// IAP reports 0 for a house-ad visit (nobody paid): keep it 0, never fall back to the visit price (2026-10-03)
|
||||||
|
const credits = Math.max(0, (info.credits != null && info.credits !== '' && isFinite(Number(info.credits))) ? Number(info.credits) : (Number(s.creditsPerVisit) || 3));
|
||||||
const usd = credits * Number(s.usdPerCredit);
|
const usd = credits * Number(s.usdPerCredit);
|
||||||
const share = usd * Number(s.poolSharePct) / 100;
|
const share = usd * Number(s.poolSharePct) / 100;
|
||||||
const rate = await usdPerPol();
|
const rate = await usdPerPol();
|
||||||
|
|||||||
Reference in New Issue
Block a user