From 6894c732fd87cb4ab2998012f481f6ceac9d6744 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Sun, 21 Nov 2021 09:07:33 +0100 Subject: [PATCH] fix: Minor fixes --- lib/pages/chat_list/chat_list_view.dart | 23 +++++++++---------- lib/utils/background_push.dart | 4 ++-- .../fluffybox_database.dart | 3 +++ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/pages/chat_list/chat_list_view.dart b/lib/pages/chat_list/chat_list_view.dart index df0cf03d..22363996 100644 --- a/lib/pages/chat_list/chat_list_view.dart +++ b/lib/pages/chat_list/chat_list_view.dart @@ -188,19 +188,18 @@ class ChatListView extends StatelessWidget { clipBehavior: Clip.hardEdge, curve: Curves.bounceInOut, decoration: const BoxDecoration(), - child: MaterialBanner( - leading: Image.asset( - 'assets/backup.png', - fit: BoxFit.contain, - width: 44, - ), - content: Text(L10n.of(context).setupChatBackupNow), - actions: [ - TextButton( - onPressed: controller.firstRunBootstrapAction, - child: Text(L10n.of(context).start), + child: Material( + color: Theme.of(context).colorScheme.surface, + child: ListTile( + leading: Image.asset( + 'assets/backup.png', + fit: BoxFit.contain, + width: 44, ), - ], + title: Text(L10n.of(context).setupChatBackupNow), + trailing: const Icon(Icons.chevron_right_outlined), + onTap: controller.firstRunBootstrapAction, + ), ), ), Expanded(child: _ChatListViewBody(controller)), diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart index ca660845..4ba11b40 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -269,9 +269,9 @@ class BackgroundPush { if (_fcmToken?.isEmpty ?? true) { try { _fcmToken = await _fcmSharedIsolate?.getToken(); - if (_fcmToken == null) throw Exception('PushToken is null'); + if (_fcmToken == null) throw ('PushToken is null'); } catch (e, s) { - Logs().e('[Push] cannot get token', e, s); + Logs().w('[Push] cannot get token', e, e is String ? null : s); await _noFcmWarning(); return; } diff --git a/lib/utils/matrix_sdk_extensions.dart/fluffybox_database.dart b/lib/utils/matrix_sdk_extensions.dart/fluffybox_database.dart index 69529e3c..65d573ee 100644 --- a/lib/utils/matrix_sdk_extensions.dart/fluffybox_database.dart +++ b/lib/utils/matrix_sdk_extensions.dart/fluffybox_database.dart @@ -50,6 +50,9 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase { hiverCipher = HiveAesCipher(base64Url.decode(rawEncryptionKey)); } on MissingPluginException catch (_) { Logs().i('FluffyBox encryption is not supported on this platform'); + } catch (_) { + const FlutterSecureStorage().delete(key: _cipherStorageKey); + rethrow; } final db = FluffyBoxDatabase(