PoE2 widget: show "—" instead of nothing when 24h change is pending

Pairs need 24h of accumulated poll history before a change% exists
(self-computed, since poe.ninja doesn't expose that window) — the
sidebar widget was silently omitting the change badge in that case
while the admin tab already showed "24h —", so a freshly tracked (or
freshly deployed) pair looked broken instead of just pending. Also
fixed the up/down color classes defaulting a null change to green via
`?? 0` — the placeholder now renders neutral, not falsely positive.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014c1L8ghNBFjfiH64UMViP8
This commit is contained in:
Claude
2026-07-25 03:18:17 +00:00
parent 37ac84c414
commit 07d7919f10
@@ -27,11 +27,9 @@
<div class="row">
<span class="label">{entry.baseName} <span class="arrow"></span> {entry.quoteName}</span>
{#if entry.lastRate !== null}
<span class="price" class:up={(entry.lastChange24h ?? 0) >= 0} class:down={(entry.lastChange24h ?? 0) < 0}>
<span class="price" class:up={entry.lastChange24h !== null && entry.lastChange24h >= 0} class:down={entry.lastChange24h !== null && entry.lastChange24h < 0}>
{formatPoeValue(entry.lastRate)}
{#if entry.lastChange24h !== null}
<span class="change">{entry.lastChange24h >= 0 ? '+' : ''}{entry.lastChange24h.toFixed(2)}%</span>
{/if}
<span class="change">{entry.lastChange24h !== null ? `${entry.lastChange24h >= 0 ? '+' : ''}${entry.lastChange24h.toFixed(2)}%` : '—'}</span>
</span>
{:else}
<span class="price"></span>