From 95c67949f7a4870cb4c7ce0361ebd7a1c54da092 Mon Sep 17 00:00:00 2001
From: Alex <alex.tran1502@gmail.com>
Date: Mon, 30 Sep 2024 20:51:47 +0700
Subject: [PATCH] fix(mobile): share to error (#13044)

---
 mobile/lib/extensions/collection_extensions.dart    | 13 -------------
 mobile/lib/widgets/asset_grid/multiselect_grid.dart |  6 +-----
 2 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/mobile/lib/extensions/collection_extensions.dart b/mobile/lib/extensions/collection_extensions.dart
index f71b0aacd3..d27c9e9500 100644
--- a/mobile/lib/extensions/collection_extensions.dart
+++ b/mobile/lib/extensions/collection_extensions.dart
@@ -70,19 +70,6 @@ extension AssetListExtension on Iterable<Asset> {
     }
     return this;
   }
-
-  /// Filters out offline assets and returns those that are still accessible by the Immich server
-  /// TODO: isOffline is removed from Immich, so this method is not useful anymore
-  Iterable<Asset> nonOfflineOnly({
-    void Function()? errorCallback,
-  }) {
-    final bool onlyLive = every((e) => false);
-    if (!onlyLive) {
-      if (errorCallback != null) errorCallback();
-      return where((a) => false);
-    }
-    return this;
-  }
 }
 
 extension SortedByProperty<T> on Iterable<T> {
diff --git a/mobile/lib/widgets/asset_grid/multiselect_grid.dart b/mobile/lib/widgets/asset_grid/multiselect_grid.dart
index 3263373554..14678903ba 100644
--- a/mobile/lib/widgets/asset_grid/multiselect_grid.dart
+++ b/mobile/lib/widgets/asset_grid/multiselect_grid.dart
@@ -131,11 +131,7 @@ class MultiselectGrid extends HookConsumerWidget {
       processing.value = true;
       if (shareLocal) {
         // Share = Download + Send to OS specific share sheet
-        // Filter offline assets since we cannot fetch their original file
-        final liveAssets = selection.value.nonOfflineOnly(
-          errorCallback: errorBuilder('asset_action_share_err_offline'.tr()),
-        );
-        handleShareAssets(ref, context, liveAssets);
+        handleShareAssets(ref, context, selection.value);
       } else {
         final ids =
             remoteSelection(errorMessage: "home_page_share_err_local".tr())