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

View file

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

View file

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

View file

@ -31,11 +31,11 @@ import { Attachment } from "../../models/attachment";
import ImageWithProgress from "../ImageWithProgress.vue";
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 {
return (source as Attachment).file !== undefined;
return (source as Attachment)?.file !== undefined;
}
const $$sanitize: any = inject("globalSanitize");

View file

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