diff options
author | Zéro~Informatique | 2022-11-06 19:34:26 +0100 |
---|---|---|
committer | Zéro~Informatique | 2022-11-06 19:41:44 +0100 |
commit | cfbff75f78963e3d24326f731590e78a4d719e9e (patch) | |
tree | 2e5436e819f8e93a1115a8142594ca80fd507bc1 /viewer/src/views/item_handlers/MarkdownViewer.vue | |
parent | 12eb302bcc93405f81b676b1a29a9731a5fec9be (diff) | |
download | ldgallery-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/views/item_handlers/MarkdownViewer.vue')
-rw-r--r-- | viewer/src/views/item_handlers/MarkdownViewer.vue | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/viewer/src/views/item_handlers/MarkdownViewer.vue b/viewer/src/views/item_handlers/MarkdownViewer.vue index d5ac7e2..574029f 100644 --- a/viewer/src/views/item_handlers/MarkdownViewer.vue +++ b/viewer/src/views/item_handlers/MarkdownViewer.vue | |||
@@ -33,13 +33,13 @@ import { LdMarkdown } from '@/components/async'; | |||
33 | import LdLoading from '@/components/LdLoading.vue'; | 33 | import LdLoading from '@/components/LdLoading.vue'; |
34 | import { useLdFetch } from '@/services/api/ldFetch'; | 34 | import { useLdFetch } from '@/services/api/ldFetch'; |
35 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; | 35 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; |
36 | import { PropType } from 'vue'; | 36 | import { PropType, toRef } from 'vue'; |
37 | 37 | ||
38 | const props = defineProps({ | 38 | const props = defineProps({ |
39 | item: { type: Object as PropType<MarkdownItem>, required: true }, | 39 | item: { type: Object as PropType<MarkdownItem>, required: true }, |
40 | }); | 40 | }); |
41 | 41 | ||
42 | const { itemResourceUrl } = useItemResource(props.item); | 42 | const { itemResourceUrl } = useItemResource(toRef(props, 'item')); |
43 | const { isFetching, data, error } = useLdFetch(itemResourceUrl).text(); | 43 | const { isFetching, data, error } = useLdFetch(itemResourceUrl).text(); |
44 | </script> | 44 | </script> |
45 | 45 | ||