Make sure file mode works

This commit is contained in:
N-Pex 2025-08-25 11:38:41 +02:00
parent ce6398685f
commit 06ad4ca644
5 changed files with 14 additions and 14 deletions

View file

@ -368,7 +368,7 @@ $hiliteColor: #4642f1;
.file-drop-sending-container { .file-drop-sending-container {
width: 100%; width: 100%;
padding: 13px 0px 15px 0px; padding: 13px 10px 15px 10px;
height: 50%; height: 50%;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
@ -435,6 +435,7 @@ $hiliteColor: #4642f1;
} }
.file-drop-sending-input-container { .file-drop-sending-input-container {
padding: 10px;
.v-btn { .v-btn {
.v-progress-circular { .v-progress-circular {
margin-left: 8px; margin-left: 8px;
@ -457,16 +458,13 @@ $hiliteColor: #4642f1;
} }
.file-drop-sent-input-container { .file-drop-sent-input-container {
padding: 10px;
background-color: transparent; background-color: transparent;
.v-btn { .v-btn {
right: unset;
left: 8px; left: 8px;
background: linear-gradient(0deg, #000 0%, #000 100%), #4642f1; right: 8px;
&.close { &.close {
right: 8px;
left: unset;
background: $hiliteColor !important; background: $hiliteColor !important;
} }
} }

View file

@ -35,7 +35,7 @@
v-on:add-files="(files) => addAttachments(files)" v-on:add-files="(files) => addAttachments(files)"
:batch="uploadBatch" :batch="uploadBatch"
v-on:close="closeFileMode" v-on:close="closeFileMode"
:showBackButton="false" :fileModeMode="true"
:defaultRootMessageText="$t('file_mode.files')" :defaultRootMessageText="$t('file_mode.files')"
/> />

View file

@ -1,7 +1,7 @@
<template> <template>
<div v-bind="{ ...$attrs }" class="send-attachments"> <div v-bind="{ ...$attrs }" class="send-attachments">
<v-btn <v-btn
v-if="showBackButton" v-if="!fileModeMode"
class="back-button clickable" class="back-button clickable"
icon="arrow_back" icon="arrow_back"
size="default" size="default"
@ -229,10 +229,10 @@ export default defineComponent({
}, },
}, },
showBackButton: { fileModeMode: {
type: Boolean, type: Boolean,
default: function () { default: function () {
return true; return false;
}, },
}, },
@ -323,7 +323,9 @@ export default defineComponent({
}, },
sendAll() { sendAll() {
this.status = this.mainStatuses.SENDING; this.status = this.mainStatuses.SENDING;
this.$emit("close"); if (!this.fileModeMode) {
this.$emit("close");
}
this.batch this.batch
.send(this.messageInput && this.messageInput.length > 0 ? this.messageInput : this.defaultRootMessageText) .send(this.messageInput && this.messageInput.length > 0 ? this.messageInput : this.defaultRootMessageText)
.then(() => { .then(() => {

View file

@ -31,11 +31,11 @@ import { Attachment } from "../../models/attachment";
import ImageWithProgress from "../ImageWithProgress.vue"; import ImageWithProgress from "../ImageWithProgress.vue";
function isEventAttachment(source: EventAttachment | Attachment | undefined): source is EventAttachment { function isEventAttachment(source: EventAttachment | Attachment | undefined): source is EventAttachment {
return (source as EventAttachment).event !== undefined; return (source as EventAttachment)?.event !== undefined;
} }
function isAttachment(source: EventAttachment | Attachment | undefined): source is Attachment { function isAttachment(source: EventAttachment | Attachment | undefined): source is Attachment {
return (source as Attachment).file !== undefined; return (source as Attachment)?.file !== undefined;
} }
const $$sanitize: any = inject("globalSanitize"); const $$sanitize: any = inject("globalSanitize");

View file

@ -15,7 +15,7 @@ export const useThumbnail = (source: KeanuEvent | File | undefined) => {
const fileSize = ref(""); const fileSize = ref("");
function isEvent(source: KeanuEvent | File | undefined): source is KeanuEvent { function isEvent(source: KeanuEvent | File | undefined): source is KeanuEvent {
return (source as KeanuEvent).getId !== undefined; return (source as KeanuEvent)?.getId !== undefined;
} }
if (isEvent(source)) { if (isEvent(source)) {