aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/services
diff options
context:
space:
mode:
authorZéro~Informatique2022-11-06 19:34:26 +0100
committerZéro~Informatique2022-11-06 19:41:44 +0100
commitcfbff75f78963e3d24326f731590e78a4d719e9e (patch)
tree2e5436e819f8e93a1115a8142594ca80fd507bc1 /viewer/src/services
parent12eb302bcc93405f81b676b1a29a9731a5fec9be (diff)
downloadldgallery-cfbff75f78963e3d24326f731590e78a4d719e9e.tar.gz
viewer/command: add item download button
Fixed a reactivity issue with props used in a composition function (useItemResource) Fixed crash with null items in LayoutTop Changed how downloadable items are identified: We use the fact they are materialized in the gallery instead of a hardly defined "listing condition". This also simplifies the code.
Diffstat (limited to 'viewer/src/services')
-rw-r--r--viewer/src/services/ui/ldItemResourceUrl.ts8
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 @@
1import { Item } from '@/@types/gallery'; 1import { Item } from '@/@types/gallery';
2import { useGalleryStore } from '@/store/galleryStore'; 2import { useGalleryStore } from '@/store/galleryStore';
3import { computed } from 'vue'; 3import { computed, ToRef } from 'vue';
4import { isDownloadableItem } from '../itemGuards'; 4import { isDownloadableItem } from '../itemGuards';
5 5
6export const useItemResource = (item: Item) => { 6export 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,