diff --git a/src/components/messages/composition/MessageImage.vue b/src/components/messages/composition/MessageImage.vue index 442793a..9c828ef 100644 --- a/src/components/messages/composition/MessageImage.vue +++ b/src/components/messages/composition/MessageImage.vue @@ -8,7 +8,7 @@ import { singleOrDoubleTapRecognizer } from "@/plugins/touch"; -import { computed, inject, onMounted, ref, useTemplateRef, watch } from "vue"; +import { computed, inject, onMounted, Ref, ref, useTemplateRef, watch } from "vue"; import MessageIncoming from "./MessageIncoming.vue"; import MessageOutgoing from "./MessageOutgoing.vue"; import ImageWithProgress from "../../ImageWithProgress.vue"; @@ -58,13 +58,17 @@ const { attachment, } = useMessage($matrix, t, props, undefined, undefined); +const imageSource: Ref = ref(undefined) + const rootComponent = computed(() => { return isIncoming.value ? MessageIncoming : MessageOutgoing; }) watch([isVisible, attachment], ([_v, _a]: [_v: boolean, _a: EventAttachment | undefined]) => { if (_v && _a) { - _a.loadThumbnail(); + _a.loadThumbnail().then(() => { + imageSource.value = attachment.value?.src ? attachment.value.src : attachment.value?.thumbnail; + }) } });