go to home after swb restore success from settings on mobile

This commit is contained in:
julian 2024-01-17 13:35:05 -06:00
parent 48ee44ed29
commit c751743436
2 changed files with 11 additions and 1 deletions

View file

@ -387,6 +387,7 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
RouteGenerator.getRoute(
builder: (_) => StackRestoreProgressView(
jsonString: jsonString,
shouldPushToHome: true,
),
),
);

View file

@ -13,6 +13,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/pages/home_view/home_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart';
@ -668,7 +669,15 @@ class _StackRestoreProgressViewState
? TextButton(
onPressed: () async {
if (_success) {
if (widget.shouldPushToHome) {
Navigator.of(context).popUntil(
ModalRoute.withName(
HomeView.routeName,
),
);
} else {
Navigator.of(context).pop();
}
} else {
if (await _requestCancel()) {
await _cancel();