Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Labels: frontend, Stellar Wave
The claimable amount on the stream detail page is fetched once and then just sits there, which looks broken for a streaming-payment product.
We already call get_claimable_amount on load. What's missing is a ticking display. The cleanest approach is to compute the value locally from rate_per_second * elapsed_seconds_since_last_checkpoint so it updates instantly, then re-sync against the API every 30s so it doesn't drift. Only tick while the stream is ACTIVE.
What the fix has to hold to
- Local counter is display-only; the API stays the source of truth via periodic re-sync
- Interval clears on unmount so we don't leak timers
- No ticking while
PAUSED or COMPLETED
Done when
Where to start
New src/hooks/useClaimableAmount.ts holds the interval + remote sync. Pull the display out into src/components/streams/ClaimableAmountDisplay.tsx and wire it up in src/app/streams/[id]/page.tsx. Add getClaimableAmount(id) to src/lib/api/streams.ts if it isn't there yet. Small frontend change, mostly hook + cleanup logic.
Labels:
frontend,Stellar WaveThe claimable amount on the stream detail page is fetched once and then just sits there, which looks broken for a streaming-payment product.
We already call
get_claimable_amounton load. What's missing is a ticking display. The cleanest approach is to compute the value locally fromrate_per_second * elapsed_seconds_since_last_checkpointso it updates instantly, then re-sync against the API every 30s so it doesn't drift. Only tick while the stream isACTIVE.What the fix has to hold to
PAUSEDorCOMPLETEDDone when
ACTIVErate_per_second * elapsed) with an API re-sync every 30sPAUSED/COMPLETEDand cleans up its interval on unmount7.0000312 XLM)Where to start
New
src/hooks/useClaimableAmount.tsholds the interval + remote sync. Pull the display out intosrc/components/streams/ClaimableAmountDisplay.tsxand wire it up insrc/app/streams/[id]/page.tsx. AddgetClaimableAmount(id)tosrc/lib/api/streams.tsif it isn't there yet. Small frontend change, mostly hook + cleanup logic.