From 2c8a1803cf6759750e6d85375959fd21d7244cc3 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 5 May 2022 09:13:54 +0200 Subject: [PATCH 1/2] chore: Follow up fix ios share files --- lib/pages/image_viewer/image_viewer_view.dart | 20 +++++++++---------- .../matrix_file_extension.dart | 3 +++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/pages/image_viewer/image_viewer_view.dart b/lib/pages/image_viewer/image_viewer_view.dart index 22a9f226..0253c3ac 100644 --- a/lib/pages/image_viewer/image_viewer_view.dart +++ b/lib/pages/image_viewer/image_viewer_view.dart @@ -32,19 +32,19 @@ class ImageViewerView extends StatelessWidget { color: Colors.white, tooltip: L10n.of(context)!.share, ), - IconButton( - icon: const Icon(Icons.download_outlined), - onPressed: controller.saveFileAction, - color: Colors.white, - tooltip: L10n.of(context)!.downloadFile, - ), if (PlatformInfos.isAndroid) IconButton( - onPressed: controller.shareFileAction, - tooltip: L10n.of(context)!.share, + icon: const Icon(Icons.download_outlined), + onPressed: controller.saveFileAction, color: Colors.white, - icon: const Icon(Icons.share), - ) + tooltip: L10n.of(context)!.downloadFile, + ), + IconButton( + onPressed: controller.shareFileAction, + tooltip: L10n.of(context)!.share, + color: Colors.white, + icon: const Icon(Icons.share), + ) ], ), body: InteractiveViewer( diff --git a/lib/utils/matrix_sdk_extensions.dart/matrix_file_extension.dart b/lib/utils/matrix_sdk_extensions.dart/matrix_file_extension.dart index 82b14d1d..20d63d45 100644 --- a/lib/utils/matrix_sdk_extensions.dart/matrix_file_extension.dart +++ b/lib/utils/matrix_sdk_extensions.dart/matrix_file_extension.dart @@ -12,6 +12,9 @@ import 'package:fluffychat/utils/platform_infos.dart'; extension MatrixFileExtension on MatrixFile { void save(BuildContext context) async { + if (PlatformInfos.isIOS) { + return share(context); + } final fileName = name.split('/').last; final file = FilePickerCross(bytes); From c3f30a317e2e5cfb9f3f4008ca472f10ca413ccd Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 5 May 2022 09:22:23 +0200 Subject: [PATCH 2/2] fix: App crashes on account switch --- lib/pages/chat_list/chat_list_body.dart | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/pages/chat_list/chat_list_body.dart b/lib/pages/chat_list/chat_list_body.dart index 83f02df6..acf286b9 100644 --- a/lib/pages/chat_list/chat_list_body.dart +++ b/lib/pages/chat_list/chat_list_body.dart @@ -25,7 +25,6 @@ class ChatListViewBody extends StatefulWidget { class _ChatListViewBodyState extends State { // the matrix sync stream late StreamSubscription _subscription; - late StreamSubscription _clientSubscription; // used to check the animation direction String? _lastUserId; @@ -40,8 +39,6 @@ class _ChatListViewBodyState extends State { .where((s) => s.hasRoomUpdate) .rateLimit(const Duration(seconds: 1)) .listen((d) => setState(() {})); - _clientSubscription = - widget.controller.clientStream.listen((d) => setState(() {})); super.initState(); } @@ -189,7 +186,6 @@ class _ChatListViewBodyState extends State { @override void dispose() { _subscription.cancel(); - _clientSubscription.cancel(); super.dispose(); }