Make images and video smaller in chat
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 55s

This commit is contained in:
2026-03-17 00:53:37 +00:00
parent c1ce3c31ba
commit a0215f7810

View File

@@ -15,8 +15,7 @@ const fileInput = ref(null);
function scrollToBottom() {
nextTick(() => {
if (messagesContainer.value) {
messagesContainer.value.scrollTop =
messagesContainer.value.scrollHeight;
messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight;
}
});
}
@@ -99,29 +98,23 @@ onUnmounted(() => {
>
<span v-else>{{ part.value }}</span>
</template>
<template
v-if="message.fileUrl && isSafeFileUrl(message.fileUrl)"
>
<template v-if="message.fileUrl && isSafeFileUrl(message.fileUrl)">
<img
v-if="isImageUrl(message.fileUrl)"
:src="message.fileUrl"
class="max-w-xs max-h-48 rounded"
class="w-full max-h-48 rounded"
@load="scrollToBottom"
/>
<video
v-else-if="isVideoUrl(message.fileUrl)"
:src="message.fileUrl"
controls
class="max-w-xs max-h-48 rounded"
class="w-full max-h-48 rounded"
@loadedmetadata="scrollToBottom"
/>
<a
v-else
:href="message.fileUrl"
target="_blank"
class="underline"
>{{ message.fileUrl.split("/").pop() }}</a
>
<a v-else :href="message.fileUrl" target="_blank" class="underline">{{
message.fileUrl.split("/").pop()
}}</a>
</template>
</p>
</div>