Code box survives a board reload: the board hands back the member's started mission, a second Start reuses the live token, and submit accepts the code of any live token of theirs for that mission (ticket IAP-1027, phones that open the site in the board's own window)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-24 08:51:00 -06:00
parent d915884409
commit 21b2f5e91b
5 changed files with 481 additions and 466 deletions
+1 -1
View File
@@ -58,7 +58,7 @@
<div class="modal" id="shareModal" hidden><div class="modal-card"><button class="modal-x" id="shareClose" type="button" aria-label="Close">×</button><div id="shareBody"></div></div></div>
<script src="https://instantadpay.com/assets/game-strip.js?v=20261003a"></script>
<script>if (window.IAPGames) IAPGames.strip(document.getElementById('moreGames'), { current: 'polhunter', title: ' ' }).then(function (n) { var m = document.getElementById('moreGames'), h = m.querySelector('.gs-h'); if (h) h.remove(); document.getElementById('moreGamesSec').hidden = !n; });</script>
<script src="/app.js?v=23"></script>
<script src="/app.js?v=24"></script>
<script src="/nas.js?v=20261024" defer></script>
</body>
</html>
+3 -2
View File
@@ -257,11 +257,12 @@
}
}
let explorer = 'https://polygonscan.com';
async function load() { board = await api('/api/my/board'); render(); }
// the server remembers a started mission, so its code box survives a reload (phones often open the site in this same window)
async function load() { board = await api('/api/my/board'); if (board && board.open && (!open || open.token !== board.open.token || open.missionId !== board.open.missionId)) open = board.open; render(); }
async function start(id) {
const r = await api('/api/my/start', { missionId: id });
if (r.error) { toast(esc(r.error), 'bad'); if (r.spent || r.dailyDone) await load(); return; }
open = { missionId: id, token: r.token, url: r.url, dwell: r.dwell, started: Date.now(), expires: r.expires };
open = { missionId: id, token: r.token, url: r.url, dwell: r.dwell, started: r.started || Date.now(), expires: r.expires };
window.open(r.url, '_blank', 'noopener');
render();
}