Fix: Force pull images in deploy workflow
All checks were successful
Build and Push / build-all (push) Successful in 7m30s
All checks were successful
Build and Push / build-all (push) Successful in 7m30s
This commit is contained in:
parent
7f56f19e94
commit
0bb461498e
7 changed files with 104 additions and 23 deletions
|
|
@ -38,19 +38,39 @@
|
|||
// Self-destruct countdown
|
||||
let countdownSeconds = 0;
|
||||
let countdownInterval = null;
|
||||
let countdownStartedAt = null;
|
||||
let initialCountdown = 0;
|
||||
$: hasSelfDestruct = message.selfDestructAt && message.selfDestructAt > 0;
|
||||
|
||||
function updateCountdown() {
|
||||
if (!message.selfDestructAt) return;
|
||||
const now = Date.now();
|
||||
const remaining = Math.max(0, Math.ceil((message.selfDestructAt - now) / 1000));
|
||||
if (!countdownStartedAt) return;
|
||||
|
||||
// Calculate elapsed time since countdown started (local time only, avoids clock skew)
|
||||
const elapsedSec = Math.floor((Date.now() - countdownStartedAt) / 1000);
|
||||
const remaining = Math.max(0, initialCountdown - elapsedSec);
|
||||
|
||||
countdownSeconds = remaining;
|
||||
|
||||
if (remaining <= 0 && countdownInterval) {
|
||||
clearInterval(countdownInterval);
|
||||
countdownInterval = null;
|
||||
}
|
||||
}
|
||||
|
||||
function startCountdown() {
|
||||
if (!message.selfDestructAt || !message.timestamp) return;
|
||||
|
||||
// Calculate the intended duration from server timestamps (no clock skew between them)
|
||||
const intendedDurationSec = Math.ceil((message.selfDestructAt - message.timestamp) / 1000);
|
||||
|
||||
// Record when we started counting down locally
|
||||
countdownStartedAt = Date.now();
|
||||
initialCountdown = intendedDurationSec;
|
||||
countdownSeconds = intendedDurationSec;
|
||||
|
||||
countdownInterval = setInterval(updateCountdown, 1000);
|
||||
}
|
||||
|
||||
function formatCountdown(seconds) {
|
||||
if (seconds >= 60) {
|
||||
const m = Math.floor(seconds / 60);
|
||||
|
|
@ -69,8 +89,7 @@
|
|||
onMount(async () => {
|
||||
// Set up self-destruct countdown if applicable
|
||||
if (message.selfDestructAt && message.selfDestructAt > 0) {
|
||||
updateCountdown();
|
||||
countdownInterval = setInterval(updateCountdown, 1000);
|
||||
startCountdown();
|
||||
}
|
||||
|
||||
// Ensure stickers are loaded (uses shared store - only fetches once across all components)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue