From 9d601c39cadfba125eac58dc23e03926a5e681e4 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Tue, 21 Jul 2026 14:25:16 +0200 Subject: [PATCH] fix: report the submitted amount in the delegation confirmation onDelegate clears the amount immediately after submitting, long before the transaction hash arrives, so useHandleTransaction recorded an amount of 0. The confirmation dialog reads that as a zero-value bond and reports a stake migration for every delegation. Capture the args on submit and record those instead. Fixes #741 Co-Authored-By: Claude Opus 4.8 (1M context) --- components/DelegatingWidget/Delegate.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/DelegatingWidget/Delegate.tsx b/components/DelegatingWidget/Delegate.tsx index 272f3b44..a5f58649 100644 --- a/components/DelegatingWidget/Delegate.tsx +++ b/components/DelegatingWidget/Delegate.tsx @@ -155,13 +155,19 @@ const Delegate = ({ error: bondError, } = useWriteContract(); + // The amount is cleared on submit, well before the hash arrives, so the + // confirmation reports what was sent rather than what the input holds now. + const [submittedArgs, setSubmittedArgs] = useState< + typeof bondWithHintArgs | null + >(null); + useHandleTransaction( "bond", bondData, bondError, bondIsLoading, bondIsSuccess, - bondWithHintArgs + submittedArgs ?? bondWithHintArgs ); const [approvalSubmitted, setApprovalSubmitted] = useState(false); @@ -208,6 +214,7 @@ const Delegate = ({ if (!bondWithHintConfig) { throw new Error("No config for bond with hint"); } + setSubmittedArgs(bondWithHintArgs); bondWrite(bondWithHintConfig.request); } catch (e) { console.error(e);