fix(homepage): show stats placeholder when database is empty

The stats recomputation task populates the cache with zero values on
startup, causing build_stat_cards() to return 6 cards even with an
empty database. Gate the stats section on stats.is_empty() in addition
to stat_cards.is_empty() so placeholders display correctly.
This commit is contained in:
Jon Seager 2026-02-09 10:13:11 +00:00
parent 2a3f9220c2
commit 6493c6495a
No known key found for this signature in database

View file

@ -241,7 +241,7 @@
>View all stats &rarr;</a >View all stats &rarr;</a
> >
</div> </div>
{% if !stat_cards.is_empty() %} {% if !stats.is_empty() && !stat_cards.is_empty() %}
<chip-scroll class="relative block"> <chip-scroll class="relative block">
<button type="button" aria-label="Scroll left" <button type="button" aria-label="Scroll left"
class="hidden absolute -left-4 top-1/2 z-10 -translate-y-1/2 items-center justify-center rounded-full border bg-surface p-1.5 text-text-muted shadow-sm transition hover:text-text" class="hidden absolute -left-4 top-1/2 z-10 -translate-y-1/2 items-center justify-center rounded-full border bg-surface p-1.5 text-text-muted shadow-sm transition hover:text-text"