From ee602e63d2f33c36774e18eaaafd865c7568aed8 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Mon, 3 Jun 2024 17:58:45 +0530 Subject: [PATCH] [mob][photos] Show loading dialog after clicking on send link till the native share sheet comes up --- .../ui/actions/collection/collection_sharing_actions.dart | 8 -------- .../ui/viewer/actions/file_selection_actions_widget.dart | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mobile/lib/ui/actions/collection/collection_sharing_actions.dart b/mobile/lib/ui/actions/collection/collection_sharing_actions.dart index 3328722dbe..c4f23df419 100644 --- a/mobile/lib/ui/actions/collection/collection_sharing_actions.dart +++ b/mobile/lib/ui/actions/collection/collection_sharing_actions.dart @@ -110,12 +110,6 @@ class CollectionActions { BuildContext context, List files, ) async { - final dialog = createProgressDialog( - context, - S.of(context).creatingLink, - isDismissible: true, - ); - await dialog.show(); try { // create album with emptyName, use collectionCreationTime on UI to // show name @@ -143,10 +137,8 @@ class CollectionActions { await collectionsService.addOrCopyToCollection(collection.id, files); logger.finest("creating public link for the newly created album"); await CollectionsService.instance.createShareUrl(collection); - await dialog.hide(); return collection; } catch (e, s) { - await dialog.hide(); await showGenericErrorDialog(context: context, error: e); logger.severe("Failing to create link for selected files", e, s); } diff --git a/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart index afc7711350..e4510b0918 100644 --- a/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart +++ b/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart @@ -651,11 +651,18 @@ class _FileSelectionActionsWidgetState ); return; } + final dialog = createProgressDialog( + context, + S.of(context).creatingLink, + isDismissible: true, + ); + await dialog.show(); _cachedCollectionForSharedLink ??= await collectionActions .createSharedCollectionLink(context, split.ownedByCurrentUser); final List ownedSelectedFiles = split.ownedByCurrentUser; placeholderPath = await _selectedFilesPlaceholderPath(ownedSelectedFiles); + await dialog.hide(); await _sendLink(); widget.selectedFiles.clearAll(); if (mounted) {