Weitere Fehler im Chastity ingame game behoben
Some checks failed
Host-Based Deploy (Java 21 Fix) / build-and-run (push) Has been cancelled
Some checks failed
Host-Based Deploy (Java 21 Fix) / build-and-run (push) Has been cancelled
This commit is contained in:
@@ -902,6 +902,10 @@
|
||||
else document.getElementById('lockContent').textContent = 'Kein Lock angegeben.';
|
||||
});
|
||||
|
||||
window.addEventListener('pageshow', (e) => {
|
||||
if (e.persisted && lockId) loadLock();
|
||||
});
|
||||
|
||||
async function loadLock() {
|
||||
const res = await fetch('/keyholder/cardlock/' + lockId);
|
||||
if (res.status === 404) {
|
||||
@@ -1322,7 +1326,13 @@
|
||||
const cdEl = document.getElementById('gameCardCountdown');
|
||||
function tick() {
|
||||
const diff = deadline - Date.now();
|
||||
if (diff <= 0) { panel.style.display = 'none'; clearInterval(gameCardPanelTick); gameCardPanelTick = null; return; }
|
||||
if (diff <= 0) {
|
||||
clearInterval(gameCardPanelTick); gameCardPanelTick = null;
|
||||
panel.style.display = 'none';
|
||||
fetch('/lock-game/penalty?lockId=' + lockId, { method: 'POST' }).catch(() => {});
|
||||
loadLock();
|
||||
return;
|
||||
}
|
||||
cdEl.textContent = fmtCountdown(diff);
|
||||
}
|
||||
tick();
|
||||
@@ -1335,7 +1345,8 @@
|
||||
const data = await res.json();
|
||||
const gameSetId = data.gameSetId;
|
||||
const url = '/games/chastity/taskgame.html?lockId=' + lockId
|
||||
+ (gameSetId ? '&gameSetId=' + gameSetId : '');
|
||||
+ (gameSetId ? '&gameSetId=' + gameSetId : '')
|
||||
+ '&fresh=1';
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user