From cfbff75f78963e3d24326f731590e78a4d719e9e Mon Sep 17 00:00:00 2001 From: Zéro~Informatique Date: Sun, 6 Nov 2022 19:34:26 +0100 Subject: 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. --- viewer/src/views/item_handlers/DownloadViewer.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'viewer/src/views/item_handlers/DownloadViewer.vue') diff --git a/viewer/src/views/item_handlers/DownloadViewer.vue b/viewer/src/views/item_handlers/DownloadViewer.vue index 6562bee..c627d3e 100644 --- a/viewer/src/views/item_handlers/DownloadViewer.vue +++ b/viewer/src/views/item_handlers/DownloadViewer.vue @@ -41,7 +41,7 @@ import { DownloadableItem } from '@/@types/gallery'; import { useNavigation } from '@/services/navigation'; import { useItemResource } from '@/services/ui/ldItemResourceUrl'; import { faFileDownload } from '@fortawesome/free-solid-svg-icons'; -import { computed, PropType } from 'vue'; +import { computed, PropType, toRef } from 'vue'; import { useI18n } from 'vue-i18n'; const props = defineProps({ @@ -52,7 +52,7 @@ const { t } = useI18n(); const navigation = useNavigation(); const itemFileName = computed(() => navigation.getFileName(props.item)); -const { itemResourceUrl } = useItemResource(props.item); +const { itemResourceUrl } = useItemResource(toRef(props, 'item'));