1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-26 10:50:29 +02:00

fix(mobile): partner assets in albums & share (#5029)

This commit is contained in:
Fynn Petersen-Frey 2023-11-14 21:32:38 +01:00 committed by GitHub
parent 5145c33ed4
commit 5d8af5f94c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View File

@ -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_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_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_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_archive_err_partner": "Can not archive partner assets, skipping",
"home_page_delete_err_partner": "Can not delete 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_error": "Download Error",
"image_viewer_page_state_provider_download_success": "Download Success", "image_viewer_page_state_provider_download_success": "Download Success",
"image_viewer_page_state_provider_share_error": "Share Error", "image_viewer_page_state_provider_share_error": "Share Error",

View File

@ -131,12 +131,19 @@ class HomePage extends HookConsumerWidget {
); );
} }
Iterable<Asset> remoteSelection({String? errorMessage}) => remoteOnly(
selection.value,
errorCallback: errorBuilder(errorMessage),
);
void onShareAssets(bool shareLocal) { void onShareAssets(bool shareLocal) {
processing.value = true; processing.value = true;
if (shareLocal) { if (shareLocal) {
handleShareAssets(ref, context, selection.value.toList()); handleShareAssets(ref, context, selection.value.toList());
} else { } 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())); context.autoPush(SharedLinkEditRoute(assetsList: ids.toList()));
} }
processing.value = false; processing.value = false;
@ -217,9 +224,8 @@ class HomePage extends HookConsumerWidget {
void onAddToAlbum(Album album) async { void onAddToAlbum(Album album) async {
processing.value = true; processing.value = true;
try { try {
final Iterable<Asset> assets = ownedRemoteSelection( final Iterable<Asset> assets = remoteSelection(
localErrorMessage: "home_page_add_to_album_err_local".tr(), errorMessage: "home_page_add_to_album_err_local".tr(),
ownerErrorMessage: "home_page_album_err_partner".tr(),
); );
if (assets.isEmpty) { if (assets.isEmpty) {
return; return;
@ -266,9 +272,8 @@ class HomePage extends HookConsumerWidget {
void onCreateNewAlbum() async { void onCreateNewAlbum() async {
processing.value = true; processing.value = true;
try { try {
final Iterable<Asset> assets = ownedRemoteSelection( final Iterable<Asset> assets = remoteSelection(
localErrorMessage: "home_page_add_to_album_err_local".tr(), errorMessage: "home_page_add_to_album_err_local".tr(),
ownerErrorMessage: "home_page_album_err_partner".tr(),
); );
if (assets.isEmpty) { if (assets.isEmpty) {
return; return;