mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-05-03 22:32:13 +00:00
Ensure widget is still mounted before showing popup
This commit is contained in:
parent
c94aed6fb1
commit
03f5544545
1 changed files with 12 additions and 10 deletions
|
@ -339,7 +339,7 @@ class SendPage extends BasePage {
|
||||||
showErrorValidationAlert(context);
|
showErrorValidationAlert(context);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await sendViewModel.createTransaction();
|
await sendViewModel.createTransaction();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -365,15 +365,17 @@ class SendPage extends BasePage {
|
||||||
reaction((_) => sendViewModel.state, (ExecutionState state) {
|
reaction((_) => sendViewModel.state, (ExecutionState state) {
|
||||||
if (state is FailureState) {
|
if (state is FailureState) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
showPopUp<void>(
|
if (context.mounted) {
|
||||||
context: context,
|
showPopUp<void>(
|
||||||
builder: (BuildContext context) {
|
context: context,
|
||||||
return AlertWithOneAction(
|
builder: (BuildContext context) {
|
||||||
alertTitle: S.of(context).error,
|
return AlertWithOneAction(
|
||||||
alertContent: state.error,
|
alertTitle: S.of(context).error,
|
||||||
buttonText: S.of(context).ok,
|
alertContent: state.error,
|
||||||
buttonAction: () => Navigator.of(context).pop());
|
buttonText: S.of(context).ok,
|
||||||
});
|
buttonAction: () => Navigator.of(context).pop());
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue