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/PdfViewer.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'viewer/src/views/item_handlers/PdfViewer.vue')

diff --git a/viewer/src/views/item_handlers/PdfViewer.vue b/viewer/src/views/item_handlers/PdfViewer.vue
index 29f8033..a6ba273 100644
--- a/viewer/src/views/item_handlers/PdfViewer.vue
+++ b/viewer/src/views/item_handlers/PdfViewer.vue
@@ -36,13 +36,13 @@
 <script setup lang="ts">
 import { PDFItem } from '@/@types/gallery';
 import { useItemResource } from '@/services/ui/ldItemResourceUrl';
-import { PropType } from 'vue';
+import { PropType, toRef } from 'vue';
 import DownloadViewer from './DownloadViewer.vue';
 
 const props = defineProps({
   item: { type: Object as PropType<PDFItem>, required: true },
 });
 
-const { itemResourceUrl } = useItemResource(props.item);
+const { itemResourceUrl } = useItemResource(toRef(props, 'item'));
 
 </script>
-- 
cgit v1.2.3

