Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion components/DelegatingWidget/Delegate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>(false);
Expand Down Expand Up @@ -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);
Expand Down
Loading