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", "name": "calckey",
"version": "12.119.0-calc.13", "version": "12.119.0-calc.13.2",
"codename": "aqua", "codename": "aqua",
"repository": { "repository": {
"type": "git", "type": "git",

View file

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

View file

@ -14,7 +14,7 @@
</div> </div>
</div> </div>
<div v-if="message.file" class="file" width="400px"> <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"> <a v-else :href="message.file.url" rel="noopener" target="_blank" :title="message.file.name">
<p>{{ message.file.name }}</p> <p>{{ message.file.name }}</p>
</a> </a>