The main issue with the Send Drawer was that the isInsufficientFunds calculation was happening before the useWaitForTransaction was confirmed. Since our balance changes, this is technically correct but is confusing because it makes it seem like our transaction has completed, even though it has not confirmed.
Adding in a check for isIdle to the isInsufficientFunds calculation fixes this, so now we won't see insufficient balance until after we get a confirmation and the useWaitForTransaction has been reset.
I've also added in closing the drawer after a send transaction is complete. I think it's pretty good, but let me know how you feel. It is easily added or removed!
Description
The main issue with the Send Drawer was that the
isInsufficientFunds
calculation was happening before theuseWaitForTransaction
was confirmed. Since our balance changes, this is technically correct but is confusing because it makes it seem like our transaction has completed, even though it has not confirmed.Adding in a check for
isIdle
to theisInsufficientFunds
calculation fixes this, so now we won't see insufficient balance until after we get a confirmation and theuseWaitForTransaction
has been reset.I've also added in closing the drawer after a send transaction is complete. I think it's pretty good, but let me know how you feel. It is easily added or removed!