fix(planner): guard scoreDelta against undefined in RecipePicker badge

Defensive null-coalescing prevents crash when suggestion data arrives
without scoreDelta (e.g. stale backend or mismatched schema).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 12:00:37 +02:00
committed by marcel
parent 2bbc3762e2
commit b45ab0fd46

View File

@@ -121,7 +121,7 @@
data-type="good" data-type="good"
style="display: inline-block; margin-top: 3px; font-size: 8px; font-weight: 500; padding: 1px 5px; border-radius: 3px; background: var(--green-tint); color: var(--green-dark);" style="display: inline-block; margin-top: 3px; font-size: 8px; font-weight: 500; padding: 1px 5px; border-radius: 3px; background: var(--green-tint); color: var(--green-dark);"
> >
↑ +{suggestion.scoreDelta.toFixed(0)} Punkte ↑ +{(suggestion.scoreDelta ?? 0).toFixed(0)} Punkte
</span> </span>
{:else} {:else}
<span <span