fix: balance card wrong oob swap

This commit is contained in:
juancwu 2026-01-18 23:38:14 +00:00
commit 91679c3aee
3 changed files with 9 additions and 13 deletions

View file

@ -86,10 +86,12 @@ templ BalanceCard(spaceID string, balance int, oob bool) {
<div
id="balance-card"
class="border rounded-lg p-4 bg-card text-card-foreground"
hx-swap-oob?={ oob }
hx-get={ "/app/spaces/" + spaceID + "/components/balance" }
hx-trigger="sse:balance_changed"
hx-swap="outerHTML"
if oob {
hx-swap-oob="true"
}
>
<h2 class="text-lg font-semibold">Current Balance</h2>
<p class={ "text-3xl font-bold", templ.KV("text-destructive", balance < 0) }>