kleros / escrow

Decentralized Escrow - Ethereum Project
https://escrow.kleros.io
MIT License
17 stars 9 forks source link

Restore button state after MetaMask transaction was cancelled #26

Open marsrobertson opened 5 years ago

marsrobertson commented 5 years ago

I cancel transaction on MetaMask.

Button remains spinning.

Of course I can reload the page.

Nice to have to restore initial button state.

cylim commented 5 years ago

I would say this is not very important since most actions doesn't depends on other actions, a refresh on the page will do.

In case if wanted to fix it, we can treat error code -32603 differently in saga.js:37

{
code: -32603, 
message: "Error: MetaMask Tx Signature: User denied transaction signature."
}

Or add the actions.setSubmitting(false) to all the Formik form.

<Formik
        onSubmit={(values, actions) => {
          CallMyApi(user.id, values)
            .error(() => {
              actions.setSubmitting(false);
            })
          );
        }}