desktop exchange navigation flow fix

This commit is contained in:
julian 2022-11-22 15:32:06 -06:00
parent 0b6545645b
commit a8b0901ec6
3 changed files with 19 additions and 0 deletions

View file

@ -37,6 +37,7 @@ class ConfirmChangeNowSendView extends ConsumerStatefulWidget {
this.routeOnSuccessName = WalletView.routeName,
required this.trade,
this.shouldSendPublicFiroFunds,
this.fromDesktopStep4 = false,
}) : super(key: key);
static const String routeName = "/confirmChangeNowSend";
@ -46,6 +47,7 @@ class ConfirmChangeNowSendView extends ConsumerStatefulWidget {
final String routeOnSuccessName;
final Trade trade;
final bool? shouldSendPublicFiroFunds;
final bool fromDesktopStep4;
@override
ConsumerState<ConfirmChangeNowSendView> createState() =>
@ -105,7 +107,17 @@ class _ConfirmChangeNowSendViewState
if (mounted) {
if (Util.isDesktop) {
Navigator.of(context, rootNavigator: true).pop();
// stupid hack
if (widget.fromDesktopStep4) {
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context, rootNavigator: true).pop();
}
}
Navigator.of(context).popUntil(ModalRoute.withName(routeOnSuccessName));
}
} catch (e) {

View file

@ -38,6 +38,7 @@ class SendFromView extends ConsumerStatefulWidget {
required this.amount,
required this.address,
this.shouldPopRoot = false,
this.fromDesktopStep4 = false,
}) : super(key: key);
static const String routeName = "/sendFrom";
@ -47,6 +48,7 @@ class SendFromView extends ConsumerStatefulWidget {
final String address;
final Trade trade;
final bool shouldPopRoot;
final bool fromDesktopStep4;
@override
ConsumerState<SendFromView> createState() => _SendFromViewState();
@ -191,6 +193,7 @@ class _SendFromViewState extends ConsumerState<SendFromView> {
amount: amount,
address: address,
trade: trade,
fromDesktopStep4: widget.fromDesktopStep4,
),
);
},
@ -210,12 +213,14 @@ class SendFromCard extends ConsumerStatefulWidget {
required this.amount,
required this.address,
required this.trade,
this.fromDesktopStep4 = false,
}) : super(key: key);
final String walletId;
final Decimal amount;
final String address;
final Trade trade;
final bool fromDesktopStep4;
@override
ConsumerState<SendFromCard> createState() => _SendFromCardState();
@ -323,6 +328,7 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
: HomeView.routeName,
trade: trade,
shouldSendPublicFiroFunds: shouldSendPublicFiroFunds,
fromDesktopStep4: widget.fromDesktopStep4,
),
settings: const RouteSettings(
name: ConfirmChangeNowSendView.routeName,

View file

@ -224,6 +224,7 @@ class _DesktopStep4State extends ConsumerState<DesktopStep4> {
amount: amount,
address: address,
shouldPopRoot: true,
fromDesktopStep4: true,
),
const RouteSettings(
name: SendFromView.routeName,