fix: possible context null check issue in exchange trade (#2253)

This commit is contained in:
Serhii 2025-05-07 17:22:03 +03:00 committed by GitHub
parent b7473594cb
commit cab4792388
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -307,9 +307,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
if (state is TransactionCommitted) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
if (!context.mounted) {
return;
}
if (!mounted) return;
await showModalBottomSheet<void>(
context: context,
@ -323,7 +321,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
actionButtonKey: ValueKey('send_page_sent_dialog_ok_button_key'),
actionButton: () {
Navigator.of(bottomSheetContext).pop();
if (context.mounted) {
if (mounted) {
Navigator.of(context).pushNamedAndRemoveUntil(
Routes.dashboard,
(route) => false,