diff options
author | pacien | 2022-11-06 20:23:11 +0100 |
---|---|---|
committer | GitHub | 2022-11-06 20:23:11 +0100 |
commit | bb3b0eae37a7214a3a4a6a1e4354e6f082adf15e (patch) | |
tree | 2e5436e819f8e93a1115a8142594ca80fd507bc1 /viewer/src/services/ui/ldItemResourceUrl.ts | |
parent | f864eeca506331c1dee2cd3f5f0df4fe806f303a (diff) | |
parent | cfbff75f78963e3d24326f731590e78a4d719e9e (diff) | |
download | ldgallery-bb3b0eae37a7214a3a4a6a1e4354e6f082adf15e.tar.gz |
Merge pull request #347 from ldgallery/p_viewer_download_button
viewer/command: add item download button
Diffstat (limited to 'viewer/src/services/ui/ldItemResourceUrl.ts')
-rw-r--r-- | viewer/src/services/ui/ldItemResourceUrl.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/viewer/src/services/ui/ldItemResourceUrl.ts b/viewer/src/services/ui/ldItemResourceUrl.ts index 7db7ab9..d6734b3 100644 --- a/viewer/src/services/ui/ldItemResourceUrl.ts +++ b/viewer/src/services/ui/ldItemResourceUrl.ts | |||
@@ -1,12 +1,12 @@ | |||
1 | import { Item } from '@/@types/gallery'; | 1 | import { Item } from '@/@types/gallery'; |
2 | import { useGalleryStore } from '@/store/galleryStore'; | 2 | import { useGalleryStore } from '@/store/galleryStore'; |
3 | import { computed } from 'vue'; | 3 | import { computed, ToRef } from 'vue'; |
4 | import { isDownloadableItem } from '../itemGuards'; | 4 | import { isDownloadableItem } from '../itemGuards'; |
5 | 5 | ||
6 | export const useItemResource = (item: Item) => { | 6 | export const useItemResource = (item: ToRef<Item>) => { |
7 | const galleryStore = useGalleryStore(); | 7 | const galleryStore = useGalleryStore(); |
8 | const itemResourceUrl = computed(() => isDownloadableItem(item) ? galleryStore.resourceRoot + item.properties.resource : ''); | 8 | const itemResourceUrl = computed(() => isDownloadableItem(item.value) ? galleryStore.resourceRoot + item.value.properties.resource : ''); |
9 | const thumbnailResourceUrl = computed(() => item.thumbnail ? galleryStore.resourceRoot + item.thumbnail.resource : ''); | 9 | const thumbnailResourceUrl = computed(() => item.value.thumbnail ? galleryStore.resourceRoot + item.value.thumbnail.resource : ''); |
10 | 10 | ||
11 | return { | 11 | return { |
12 | itemResourceUrl, | 12 | itemResourceUrl, |