Wall: drop the view countdown — a click marks the ad viewed and unlocks join

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-07 10:13:22 -05:00
parent 0c803c07cb
commit 2bfe019c16
2 changed files with 5 additions and 13 deletions
+4 -12
View File
@@ -64,18 +64,10 @@
const btn = document.createElement('button');
btn.className = 'btn small'; btn.textContent = 'View this ad';
btn.addEventListener('click', () => {
window.open(m.targetUrl, '_blank'); // real visit to the advertiser
let left = DWELL;
btn.disabled = true;
act.innerHTML = '<span class="wc-timer">Viewing… ' + left + 's</span>';
const t = setInterval(() => {
left--;
if (left > 0) { act.querySelector('.wc-timer').textContent = 'Viewing… ' + left + 's'; return; }
clearInterval(t);
viewed[i] = 1;
try { localStorage.setItem(VKEY, JSON.stringify(viewed)); } catch (e) {}
done(); updateGate();
}, 1000);
window.open(m.targetUrl, '_blank'); // real visit to the advertiser (no countdown)
viewed[i] = 1;
try { localStorage.setItem(VKEY, JSON.stringify(viewed)); } catch (e) {}
done(); updateGate();
});
act.appendChild(btn);
}