Skip to content

Commit

Permalink
fix(mobile): share to error
Browse files Browse the repository at this point in the history
  • Loading branch information
alextran1502 committed Sep 30, 2024
1 parent 7adb35e commit c5470cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
13 changes: 0 additions & 13 deletions mobile/lib/extensions/collection_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
6 changes: 1 addition & 5 deletions mobile/lib/widgets/asset_grid/multiselect_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit c5470cb

Please sign in to comment.