mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
exit wallet when backing out from wallet view on mobile
This commit is contained in:
parent
15aeb39776
commit
469ab91dfd
1 changed files with 21 additions and 0 deletions
|
@ -59,6 +59,7 @@ import 'package:stackwallet/utilities/clipboard_interface.dart';
|
|||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart';
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/utilities/show_loading.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
|
@ -305,6 +306,26 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
BackupFrequencyType.afterClosingAWallet) {
|
||||
unawaited(ref.read(autoSWBServiceProvider).doBackup());
|
||||
}
|
||||
|
||||
// Close the wallet according to syncing preferences.
|
||||
switch (ref.read(prefsChangeNotifierProvider).syncType) {
|
||||
case SyncingType.currentWalletOnly:
|
||||
// Close the wallet.
|
||||
unawaited(ref.watch(pWallets).getWallet(walletId).exit());
|
||||
// unawaited so we don't lag the UI.
|
||||
case SyncingType.selectedWalletsAtStartup:
|
||||
// Close if this wallet is not in the list to be synced.
|
||||
if (!ref
|
||||
.read(prefsChangeNotifierProvider)
|
||||
.walletIdsSyncOnStartup
|
||||
.contains(widget.walletId)) {
|
||||
unawaited(ref.watch(pWallets).getWallet(walletId).exit());
|
||||
// unawaited so we don't lag the UI.
|
||||
}
|
||||
case SyncingType.allWalletsOnStartup:
|
||||
// Do nothing.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildNetworkIcon(WalletSyncStatus status) {
|
||||
|
|
Loading…
Reference in a new issue