Skip to content

fix: delegation confirmation reports a stake migration #741

Description

@rickstaa

Every plain delegation shows the wrong confirmation:

Congrats! You've successfully migrated your stake to a new orchestrator.

TxConfirmedDialog/index.tsx:120 picks the copy from the recorded amount, which is correct in principle — a genuine "Move Delegated Stake" bonds zero:

Number(tx.inputData.amount) <= 0
  ? "...migrated your stake to a new orchestrator."
  : "...delegated N LPT."

The amount it reads has already been cleared. onDelegate in components/DelegatingWidget/Delegate.tsx calls bondWrite(...) and then reset()setAmount("") (components/DelegatingWidget/index.tsx:199) without waiting for the hash. useHandleTransaction's useEffect(..., [data]) later stores setLatestTransactionDetails(data, id, args) using the current args, by which point the amount is 0.

The hash can never arrive before reset() runs, so this is deterministic rather than a race.

Reproduction

Delegate any amount to an orchestrator and read the success dialog.

Fix

Capture the args when the transaction is submitted and hand those to useHandleTransaction, so the confirmation reflects what was sent.

Display only — the transaction itself is unaffected. unbond does not share the problem; Undelegate.tsx never calls reset().

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions