From 7bae610c05783c1af38fcd75d3f5381d9d76202b Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Thu, 26 Nov 2026 00:55:00 -0500 Subject: [PATCH] fixup android sharing --- lib/widgets/rooms/share_sheet.dart | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/widgets/rooms/share_sheet.dart b/lib/widgets/rooms/share_sheet.dart index d0eef1b..ecd2df6 100644 --- a/lib/widgets/rooms/share_sheet.dart +++ b/lib/widgets/rooms/share_sheet.dart @@ -1,3 +1,5 @@ +import "dart:io"; + import "package:collection/collection.dart"; import "package:fast_immutable_collections/fast_immutable_collections.dart"; import "package:file_selector/file_selector.dart"; @@ -40,13 +42,12 @@ class const ShareSheet(final IList files, {super.key}) (room) => [(room.name, 2), (room.canonicalAlias, 1)], ); - final text = files - .where((file) => file.type == .text || file.type == .url) - .map((file) => file.path) - .join("\n"); - final file = files.firstWhereOrNull( - (file) => file.type != .text && file.type != .url, - ); + bool isText(SharedMediaFile file) => + file.type == .url || + (file.type == .text && !File(file.path).existsSync()); + + final text = files.where(isText).map((file) => file.path).join("\n"); + final file = files.firstWhereOrNull((file) => !isText(file)); Future shareTo(String roomId) async { final container = ProviderScope.containerOf(context);