Fix: Force pull images in deploy workflow
All checks were successful
Build and Push / build-all (push) Successful in 7m30s

This commit is contained in:
doomtube 2026-01-06 23:56:06 -05:00
parent 7f56f19e94
commit 0bb461498e
7 changed files with 104 additions and 23 deletions

View file

@ -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)