From 0df997d594cdd8197cf8c1bc99ec2c88f7b16401 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Wed, 11 Jun 2025 22:24:00 -0400 Subject: [PATCH] Load initial high five count --- layouts/partials/highfive.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/layouts/partials/highfive.html b/layouts/partials/highfive.html index 0af3673..a40c668 100644 --- a/layouts/partials/highfive.html +++ b/layouts/partials/highfive.html @@ -96,6 +96,9 @@ // Enable button now that JavaScript is available elements.button.classList.remove('no-js'); elements.button.addEventListener('click', handleHighFiveClick); + + // Load initial count + loadHighFiveCount(); } /** @@ -149,7 +152,7 @@ const data = await makeApiRequest('POST'); const newCount = data.count || currentCount; currentCount = newCount; - + // Check if user already gave a high five (HTTP 409 response) if (data.alreadyHighFived) { updateButtonContent('check'); @@ -160,7 +163,7 @@ showMessage('🎉 Thanks!', 'success'); setButtonState('disabled'); } - + } catch (error) { console.error('Failed to send high five:', error);