Skip to content

Commit

Permalink
fix(mobile): partner assets in albums & share (immich-app#5029)
Browse files Browse the repository at this point in the history
  • Loading branch information
fyfrey authored Nov 14, 2023
1 parent 5145c33 commit 5d8af5f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mobile/assets/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@
"home_page_first_time_notice": "If this is your first time using the app, please make sure to choose a backup album(s) so that the timeline can populate photos and videos in the album(s).",
"home_page_upload_err_limit": "Can only upload a maximum of 30 assets at a time, skipping",
"home_page_favorite_err_partner": "Can not favorite partner assets yet, skipping",
"home_page_album_err_partner": "Can not add partner assets to an album yet, skipping",
"home_page_archive_err_partner": "Can not archive partner assets, skipping",
"home_page_delete_err_partner": "Can not delete partner assets, skipping",
"home_page_share_err_local": "Can not share local assets via link, skipping",
"image_viewer_page_state_provider_download_error": "Download Error",
"image_viewer_page_state_provider_download_success": "Download Success",
"image_viewer_page_state_provider_share_error": "Share Error",
Expand Down
19 changes: 12 additions & 7 deletions mobile/lib/modules/home/views/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,19 @@ class HomePage extends HookConsumerWidget {
);
}

Iterable<Asset> remoteSelection({String? errorMessage}) => remoteOnly(
selection.value,
errorCallback: errorBuilder(errorMessage),
);

void onShareAssets(bool shareLocal) {
processing.value = true;
if (shareLocal) {
handleShareAssets(ref, context, selection.value.toList());
} else {
final ids = ownedRemoteSelection().map((e) => e.remoteId!);
final ids =
remoteSelection(errorMessage: "home_page_share_err_local".tr())
.map((e) => e.remoteId!);
context.autoPush(SharedLinkEditRoute(assetsList: ids.toList()));
}
processing.value = false;
Expand Down Expand Up @@ -217,9 +224,8 @@ class HomePage extends HookConsumerWidget {
void onAddToAlbum(Album album) async {
processing.value = true;
try {
final Iterable<Asset> assets = ownedRemoteSelection(
localErrorMessage: "home_page_add_to_album_err_local".tr(),
ownerErrorMessage: "home_page_album_err_partner".tr(),
final Iterable<Asset> assets = remoteSelection(
errorMessage: "home_page_add_to_album_err_local".tr(),
);
if (assets.isEmpty) {
return;
Expand Down Expand Up @@ -266,9 +272,8 @@ class HomePage extends HookConsumerWidget {
void onCreateNewAlbum() async {
processing.value = true;
try {
final Iterable<Asset> assets = ownedRemoteSelection(
localErrorMessage: "home_page_add_to_album_err_local".tr(),
ownerErrorMessage: "home_page_album_err_partner".tr(),
final Iterable<Asset> assets = remoteSelection(
errorMessage: "home_page_add_to_album_err_local".tr(),
);
if (assets.isEmpty) {
return;
Expand Down

0 comments on commit 5d8af5f

Please sign in to comment.