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/PlainTextViewer.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'viewer/src/views/item_handlers/PlainTextViewer.vue') diff --git a/viewer/src/views/item_handlers/PlainTextViewer.vue b/viewer/src/views/item_handlers/PlainTextViewer.vue index d386437..2ab429a 100644 --- a/viewer/src/views/item_handlers/PlainTextViewer.vue +++ b/viewer/src/views/item_handlers/PlainTextViewer.vue @@ -37,13 +37,13 @@ import { PlainTextItem } from '@/@types/gallery'; import LdLoading from '@/components/LdLoading.vue'; import { useItemResource } from '@/services/ui/ldItemResourceUrl'; import { useFetch } from '@vueuse/core'; -import { PropType } from 'vue'; +import { PropType, toRef } from 'vue'; const props = defineProps({ item: { type: Object as PropType, required: true }, }); -const { itemResourceUrl } = useItemResource(props.item); +const { itemResourceUrl } = useItemResource(toRef(props, 'item')); const { isFinished, data } = useFetch(itemResourceUrl).text(); -- cgit v1.2.3