fix: 🐛 fix image size in dms

This commit is contained in:
ThatOneCalculator 2022-11-14 20:25:59 -08:00
parent f1ea811a51
commit d55f2bd1d4
3 changed files with 9 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "calckey",
"version": "12.119.0-calc.13",
"version": "12.119.0-calc.13.2",
"codename": "aqua",
"repository": {
"type": "git",

View file

@ -1,7 +1,7 @@
<template>
<div class="hoawjimk">
<XBanner v-for="media in mediaList.filter(media => !previewable(media))" :key="media.id" :media="media"/>
<div v-if="mediaList.filter(media => previewable(media)).length > 0" class="gird-container">
<div v-if="mediaList.filter(media => previewable(media)).length > 0" class="gird-container" :class="{ width400: inDm }">
<div ref="gallery" :data-count="mediaList.filter(media => previewable(media)).length">
<template v-for="media in mediaList.filter(media => previewable(media))">
<XVideo v-if="media.type.startsWith('video')" :key="media.id" :video="media"/>
@ -28,6 +28,7 @@ import { defaultStore } from '@/store';
const props = defineProps<{
mediaList: misskey.entities.DriveFile[];
raw?: boolean;
inDm?: boolean;
}>();
const gallery = ref(null);
@ -103,6 +104,11 @@ const previewable = (file: misskey.entities.DriveFile): boolean => {
<style lang="scss" scoped>
.hoawjimk {
> .width400 {
width: 400px !important;
}
> .gird-container {
position: relative;
width: 100%;

View file

@ -14,7 +14,7 @@
</div>
</div>
<div v-if="message.file" class="file" width="400px">
<XMediaList v-if="message.file.type.split('/')[0] == 'image' || message.file.type.split('/')[0] == 'video'" width="400px" :media-list="[message.file]" max-width="400px" style="border-radius: 5px"/>
<XMediaList v-if="message.file.type.split('/')[0] == 'image' || message.file.type.split('/')[0] == 'video'" width="400px" :media-list="[message.file]" style="border-radius: 5px"/>
<a v-else :href="message.file.url" rel="noopener" target="_blank" :title="message.file.name">
<p>{{ message.file.name }}</p>
</a>