From ec57a926fc0af15c4e0d091646f41e8d2c121098 Mon Sep 17 00:00:00 2001 From: martbost Date: Mon, 5 Oct 2026 08:28:54 -0500 Subject: [PATCH] Welcome back bonus: +250 earned credits on the first sign-in after 7+ days away (settings comebackBonus/comebackDays) Co-Authored-By: Claude Opus 5.5 --- ads.js | Bin 140527 -> 141246 bytes public/assets/my.js | 3 ++- public/my.html | 2 +- server.js | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ads.js b/ads.js index 8179d27164583d38fca635d39e7320cabce7e62a..a739ade45bf02f8d740a46945ea8cb103b230311 100644 GIT binary patch delta 743 zcmaJ6S9jZz7| zL56&WPB0)vEG$e+d=x$b67McjPJO6zqd7jH z({W`xQke`zbcU#qabh&&g((EY*vR63$FZ2{U5HZ5zfB9&`{D8!J= zn@Kwp7c8)YP+h2L97-`GTY)RcXL@rAl3nOojcF`Pld;K7w_oT_&r_zj)Ofrr>`SLfzZ^(%Ca5L99 zRjODpma7siCv;>uI(V`FJg|=gJ5Q;kY;Lwgzx5y!9G6*Icas1~mNG`wfa&p+zETe?u?Qw`QcwOBNoTOLQxo0wzH2bizkH)@Ub U*;B9PJtmsU+-A~s3h(3AU%21yjsO4v delta 48 zcmV-00MGxv&j|0y2!MnEv;tBYlc)SMx9%AN%> { - if (r && r.granted > 0) { + if (r && r.comeback > 0) { IAP.status('๐ŸŽ‰ Welcome back! +' + r.comeback + ' bonus credits for coming back, plus +' + r.granted + ' for signing in today.', 'ok'); playSound('chaching'); setTimeout(loadDashboard, 900); } + else if (r && r.granted > 0) { IAP.status('๐ŸŽ Daily login bonus: +' + r.granted + ' credits' + (r.streak > 1 ? ' ยท ' + r.streak + '-day streak' : '') + '!', 'ok'); playSound('chaching'); setTimeout(loadDashboard, 900); } diff --git a/public/my.html b/public/my.html index 43a3b88..ca41fc6 100644 --- a/public/my.html +++ b/public/my.html @@ -1131,7 +1131,7 @@ - + diff --git a/server.js b/server.js index 7404d06..a2c11c6 100644 --- a/server.js +++ b/server.js @@ -3456,7 +3456,8 @@ const server = http.createServer(async (req, res) => { if (p === '/api/my/login-bonus' && req.method === 'POST') { const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' }); - return json(res, 200, await ads.grantLoginBonus(s.email)); + const cfg = siteConfig(); // comebackBonus (250) after comebackDays (7) away; 0 switches it off + return json(res, 200, await ads.grantLoginBonus(s.email, { comeback: cfg.comebackBonus == null ? 250 : Number(cfg.comebackBonus), comebackDays: cfg.comebackDays == null ? 7 : Number(cfg.comebackDays) })); } // -- rehearsal test-POL faucet: top a connected wallet up to 10 test-POL // (anvil_setBalance, no key needed). Rehearsal-only, rate-limited.