From 06f1d0dc4d1375fd9b21e77a3088401d8cbca209 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 17 Jun 2025 15:56:42 -0500 Subject: [PATCH] fix(mobile): correct share option for local asset (#19233) --- mobile/lib/services/share.service.dart | 2 +- .../asset_grid/control_bottom_app_bar.dart | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/mobile/lib/services/share.service.dart b/mobile/lib/services/share.service.dart index d44d75931d..77afa10fb6 100644 --- a/mobile/lib/services/share.service.dart +++ b/mobile/lib/services/share.service.dart @@ -30,7 +30,7 @@ class ShareService { for (var asset in assets) { if (asset.isLocal) { // Prefer local assets to share - File? f = await asset.local!.file; + File? f = await asset.local!.originFile; downloadedXFiles.add(XFile(f!.path)); } else if (asset.isRemote) { // Download remote asset otherwise diff --git a/mobile/lib/widgets/asset_grid/control_bottom_app_bar.dart b/mobile/lib/widgets/asset_grid/control_bottom_app_bar.dart index 3859e5ec1b..3283b90b21 100644 --- a/mobile/lib/widgets/asset_grid/control_bottom_app_bar.dart +++ b/mobile/lib/widgets/asset_grid/control_bottom_app_bar.dart @@ -131,15 +131,14 @@ class ControlBottomAppBar extends HookConsumerWidget { List renderActionButtons() { return [ - if (hasRemote) - ControlBoxButton( - iconData: Platform.isAndroid - ? Icons.share_rounded - : Icons.ios_share_rounded, - label: "share".tr(), - onPressed: enabled ? () => onShare(true) : null, - ), - if (!isInLockedView) + ControlBoxButton( + iconData: Platform.isAndroid + ? Icons.share_rounded + : Icons.ios_share_rounded, + label: "share".tr(), + onPressed: enabled ? () => onShare(true) : null, + ), + if (!isInLockedView && hasRemote) ControlBoxButton( iconData: Icons.link_rounded, label: "share_link".tr(),