parent
2dfaef9b8f
commit
77f3b81e21
1 changed files with 7 additions and 3 deletions
|
|
@ -8,7 +8,7 @@
|
|||
<ImageWithProgress v-if="attachment"
|
||||
:aspect-ratio="16 / 9"
|
||||
ref="image"
|
||||
:src="attachment.src ? attachment.src : attachment.thumbnail"
|
||||
:src="imageSource"
|
||||
:cover="cover"
|
||||
:contain="contain"
|
||||
:loadingProgress="attachment.thumbnailProgress"
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
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<string | undefined> = 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;
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue