Skip to content

[Frontend] Stream-detail progress bar throws on deposited === 0 (BigInt division by zero) #550

Description

@ogazboiz

Telegram: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

In frontend/src/app/streams/[id]/page.tsx the progress bar computes:

width: `${Math.min(100, Number((withdrawn * 100n) / deposited))}%`

deposited is BigInt(stream.depositedAmount). If a stream's depositedAmount is "0" (e.g. a freshly indexed/edge-case stream, or a fee that consumed the full deposit), (withdrawn * 100n) / deposited is a BigInt divide-by-zero, which throws RangeError and crashes the page render.

Acceptance criteria

  • Guard the division: render 0% (or 100% when fully withdrawn) when deposited === 0n
  • Verify the page renders for a stream with depositedAmount: "0"

Files to touch

  • frontend/src/app/streams/[id]/page.tsx (Stream Progress section)

Out of scope

  • The live-claimable counter logic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendFrontend related tasks

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions