diff --git a/src/App.vue b/src/App.vue index 504daecd..dcb2ee1a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -62,6 +62,7 @@ + @@ -91,6 +92,7 @@ import NodeShareModal from '@components/modal/NodeShareModal.vue'; import ShareModal from '@components/modal/ShareModal.vue'; import MoveToFolderModal from '@components/modal/MoveToFolderModal.vue'; import FaceMoveModal from '@components/modal/FaceMoveModal.vue'; +import AlbumShareModal from '@components/modal/AlbumShareModal.vue'; import * as utils from '@services/utils'; import * as nativex from '@native'; @@ -139,6 +141,7 @@ export default defineComponent({ ShareModal, MoveToFolderModal, FaceMoveModal, + AlbumShareModal, ImageMultiple, FolderIcon, diff --git a/src/components/modal/AlbumCollaborators.vue b/src/components/modal/AlbumCollaborators.vue index 51785bdf..9d91ca6d 100644 --- a/src/components/modal/AlbumCollaborators.vue +++ b/src/components/modal/AlbumCollaborators.vue @@ -334,6 +334,12 @@ export default defineComponent({ }, async createPublicLinkForAlbum() { + // Check if link already exists + if (this.isPublicLinkSelected) { + return await this.copyPublicLink(); + } + + // Create new link this.selectEntity(`${Type.SHARE_TYPE_LINK}`); await this.updateAlbumCollaborators(); try { @@ -343,9 +349,7 @@ export default defineComponent({ if (!utils.uid) return; const album = await dav.getAlbum(utils.uid, this.albumName); this.populateCollaborators(album.collaborators); - - // Direct share if native share is available - if (nativex.has()) this.copyPublicLink(); + await this.copyPublicLink(); } catch (error) { if (error.response?.status === 404) { this.errorFetchingAlbum = 404; @@ -396,16 +400,12 @@ export default defineComponent({ await navigator.clipboard.writeText(link); this.publicLinkCopied = true; - setTimeout(() => { - this.publicLinkCopied = false; - }, 10000); + await new Promise((resolve) => setTimeout(resolve, 2000)); + this.publicLinkCopied = false; }, selectEntity(collaboratorKey: string) { - if (this.selectedCollaboratorsKeys.includes(collaboratorKey)) { - return; - } - + if (this.selectedCollaboratorsKeys.includes(collaboratorKey)) return; this.refs.popover?.$refs.popover.hide(); this.selectedCollaboratorsKeys.push(collaboratorKey); }, diff --git a/src/components/modal/AlbumShareModal.vue b/src/components/modal/AlbumShareModal.vue index 09df467e..b1c92aa1 100644 --- a/src/components/modal/AlbumShareModal.vue +++ b/src/components/modal/AlbumShareModal.vue @@ -4,8 +4,24 @@ {{ t('memories', 'Share Album') }} + +