From af3c5c896afcc2104840f0e803c9da4372453013 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 16 Sep 2022 07:33:22 -0600 Subject: [PATCH] add back button to wallet view --- lib/pages/wallet_view/wallet_view.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index 72227092f..b06b8627c 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -189,7 +189,7 @@ class _WalletViewState extends ConsumerState { return false; } - void _logout() { + void _logout() async { if (_shouldDisableAutoSyncOnLogOut) { // disable auto sync if it was enabled only when loading wallet ref.read(managerProvider).shouldAutoSync = false; @@ -199,7 +199,7 @@ class _WalletViewState extends ConsumerState { if (ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled && ref.read(prefsChangeNotifierProvider).backupFrequencyType == BackupFrequencyType.afterClosingAWallet) { - ref.read(autoSWBServiceProvider).doBackup(); + unawaited(ref.read(autoSWBServiceProvider).doBackup()); } } @@ -364,7 +364,13 @@ class _WalletViewState extends ConsumerState { onWillPop: _onWillPop, child: Scaffold( appBar: AppBar( - automaticallyImplyLeading: false, + leading: AppBarBackButton( + onPressed: () { + _logout(); + Navigator.of(context).pop(); + }, + ), + titleSpacing: 0, title: Row( children: [ SvgPicture.asset(