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>
|
<div>
|
||||||
<p>{message}</p>
|
<p>{message}</p>
|
||||||
<p>
|
<p>
|
||||||
<Link to={Routes.STAKING}>{t('backToStaking')}</Link>
|
<Link className="underline" to={Routes.STAKING}>
|
||||||
|
{t('backToStaking')}
|
||||||
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</Callout>
|
</Callout>
|
||||||
|
@ -147,8 +147,12 @@ export const StakingForm = ({
|
|||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const command = action === Actions.Add ? delegateInput : undelegateInput;
|
const command = action === Actions.Add ? delegateInput : undelegateInput;
|
||||||
await sendTx(command);
|
const res = await sendTx(command);
|
||||||
setFormState(FormState.Pending);
|
if (res) {
|
||||||
|
setFormState(FormState.Pending);
|
||||||
|
} else {
|
||||||
|
setFormState(FormState.Default);
|
||||||
|
}
|
||||||
|
|
||||||
// await success via poll
|
// await success via poll
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user