Make images and video smaller in chat
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 55s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 55s
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user