Allow setting default text for media messages

This commit is contained in:
N-Pex 2025-06-26 12:11:58 +02:00
parent a0109f93af
commit b0fae3396d
2 changed files with 10 additions and 2 deletions

View file

@ -34,6 +34,7 @@
:batch="uploadBatch"
v-on:close="closeFileMode"
:showBackButton="false"
:defaultRootMessageText="$t('file_mode.files')"
/>
<div v-if="!useVoiceMode && !useFileModeNonAdmin" :class="{'chat-content': true, 'flex-grow-1': true, 'flex-shrink-1': true, 'invisible': !initialLoadDone}" ref="chatContainer"
@ -316,7 +317,6 @@ import MessageOperationsBottomSheet from "./MessageOperationsBottomSheet";
import StickerPickerBottomSheet from "./StickerPickerBottomSheet";
import UserProfileDialog from "./UserProfileDialog.vue"
import BottomSheet from "./BottomSheet.vue";
import imageResize from "image-resize";
import CreatePollDialog from "./CreatePollDialog.vue";
import chatMixin, { ROOM_READ_MARKER_EVENT_PLACEHOLDER } from "./chatMixin";
import AudioLayout from "./AudioLayout.vue";

View file

@ -206,12 +206,20 @@ export default defineComponent({
components: { C2PABadge, AttachmentInfo },
emits: ["pick-file", "close"],
props: {
defaultRootMessageText: {
type: String,
default: function () {
return ""
}
},
showBackButton: {
type: Boolean,
default: function () {
return true;
},
},
batch: {
type: Object,
default: function () {
@ -295,7 +303,7 @@ export default defineComponent({
sendAll() {
this.status = this.mainStatuses.SENDING;
this.batch
.send(this.messageInput && this.messageInput.length > 0 ? this.messageInput : this.$t("file_mode.files"))
.send(this.messageInput && this.messageInput.length > 0 ? this.messageInput : this.defaultRootMessageText)
.then(() => {
this.status = this.mainStatuses.SENT;
});