mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: view shared link (#23766)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import SharedLinkCopy from '$lib/components/sharedlinks-page/actions/shared-link-copy.svelte';
|
||||
import { handleViewSharedLinkQrCode } from '$lib/services/shared-link.service';
|
||||
import { locale } from '$lib/stores/preferences.store';
|
||||
import type { AlbumResponseDto, SharedLinkResponseDto } from '@immich/sdk';
|
||||
import { IconButton, Text } from '@immich/ui';
|
||||
@@ -10,10 +11,9 @@
|
||||
type Props = {
|
||||
album: AlbumResponseDto;
|
||||
sharedLink: SharedLinkResponseDto;
|
||||
onViewQrCode: () => void;
|
||||
};
|
||||
|
||||
const { album, sharedLink, onViewQrCode }: Props = $props();
|
||||
const { album, sharedLink }: Props = $props();
|
||||
|
||||
const getShareProperties = () =>
|
||||
[
|
||||
@@ -46,8 +46,8 @@
|
||||
color="secondary"
|
||||
variant="ghost"
|
||||
icon={mdiQrcode}
|
||||
onclick={onViewQrCode}
|
||||
onclick={() => handleViewSharedLinkQrCode(sharedLink)}
|
||||
/>
|
||||
<SharedLinkCopy link={sharedLink} />
|
||||
<SharedLinkCopy {sharedLink} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
import { AppRoute } from '$lib/constants';
|
||||
import AlbumEditModal from '$lib/modals/AlbumEditModal.svelte';
|
||||
import AlbumShareModal from '$lib/modals/AlbumShareModal.svelte';
|
||||
import QrCodeModal from '$lib/modals/QrCodeModal.svelte';
|
||||
import SharedLinkCreateModal from '$lib/modals/SharedLinkCreateModal.svelte';
|
||||
import { handleConfirmAlbumDelete, handleDownloadAlbum } from '$lib/services/album.service';
|
||||
import { handleViewSharedLinkQrCode } from '$lib/services/shared-link.service';
|
||||
import {
|
||||
AlbumFilter,
|
||||
AlbumGroupBy,
|
||||
@@ -23,7 +23,6 @@
|
||||
} from '$lib/stores/preferences.store';
|
||||
import { user } from '$lib/stores/user.store';
|
||||
import { userInteraction } from '$lib/stores/user.svelte';
|
||||
import { makeSharedLinkUrl } from '$lib/utils';
|
||||
import { getSelectedAlbumGroupOption, sortAlbums, stringToSortOrder, type AlbumGroup } from '$lib/utils/album-utils';
|
||||
import type { ContextMenuPosition } from '$lib/utils/context-menu';
|
||||
import { handleError } from '$lib/utils/handle-error';
|
||||
@@ -259,7 +258,7 @@
|
||||
const sharedLink = await modalManager.show(SharedLinkCreateModal, { albumId: selectedAlbum.id });
|
||||
if (sharedLink) {
|
||||
handleSharedLinkCreated(selectedAlbum);
|
||||
await modalManager.show(QrCodeModal, { title: $t('view_link'), value: makeSharedLinkUrl(sharedLink) });
|
||||
await handleViewSharedLinkQrCode(sharedLink);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user