fix: do not show success state if user cancels tx (#1562)
This commit is contained in:
parent
520f767d09
commit
96811b45e3
@ -34,7 +34,9 @@ export const StakeSuccess = ({
|
||||
<div>
|
||||
<p>{message}</p>
|
||||
<p>
|
||||
<Link to={Routes.STAKING}>{t('backToStaking')}</Link>
|
||||
<Link className="underline" to={Routes.STAKING}>
|
||||
{t('backToStaking')}
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
</Callout>
|
||||
|
@ -147,8 +147,12 @@ export const StakingForm = ({
|
||||
};
|
||||
try {
|
||||
const command = action === Actions.Add ? delegateInput : undelegateInput;
|
||||
await sendTx(command);
|
||||
setFormState(FormState.Pending);
|
||||
const res = await sendTx(command);
|
||||
if (res) {
|
||||
setFormState(FormState.Pending);
|
||||
} else {
|
||||
setFormState(FormState.Default);
|
||||
}
|
||||
|
||||
// await success via poll
|
||||
} catch (err) {
|
||||
|
Loading…
Reference in New Issue
Block a user