Support for retry when sending media

This commit is contained in:
N-Pex 2025-08-21 16:07:13 +02:00
parent 881270f149
commit ce6398685f
7 changed files with 69 additions and 34 deletions

View file

@ -1,5 +1,5 @@
<template>
<MessageOutgoing :is="rootComponent" ref="root" v-bind="{ ...$props, ...$attrs }">
<MessageOutgoing v-bind="{ ...$props, ...$attrs }">
<div class="bubble">
<div class="original-message" v-if="inReplyToText">
<div class="original-message-sender">{{ inReplyToSender }}</div>
@ -20,11 +20,15 @@
<v-icon size="8">close</v-icon> </v-progress-circular
>{{ uploadBatch?.progressPercent }}%
</div>
<div class="message-upload-progress clickable" @click.stop="retryUpload" v-else-if="unref(uploadBatch?.sendingStatus) === 'failed'">
<v-icon size="12">$vuetify.icons.ic_arrow_narrow</v-icon>
<div>{{ t("global.retry") }}</div>
</div>
<SwipeableThumbnailsView :items="items" v-if="room.displayType == ROOM_TYPE_CHANNEL" v-bind="$attrs" />
<v-container v-else fluid class="imageCollection">
<v-row wrap>
<v-col v-for="{ size, item } in layoutedItems" :key="item.file.name + item.file.size" :cols="size">
<ThumbnailView :file="item" v-on:itemclick="onItemClick($event)" />
<ThumbnailView :item="item" v-on:itemclick="onItemClick($event)" />
</v-col>
</v-row>
</v-container>
@ -83,6 +87,12 @@ const cancelUpload = () => {
}
}
const retryUpload = () => {
if (uploadBatch.value) {
uploadBatch.value.send(uploadBatch.value.sendingRootMessage.value ?? "");
}
}
const onItemClick = (event: any) => {
showItem.value = event.item;
};