diff --git a/lib/pages/chat_list/chat_list_body.dart b/lib/pages/chat_list/chat_list_body.dart index 256784ec..438dd281 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(); } @@ -194,7 +191,6 @@ class _ChatListViewBodyState extends State { @override void dispose() { _subscription.cancel(); - _clientSubscription.cancel(); super.dispose(); } 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);