updated failed message handler

This commit is contained in:
DJ2LS 2023-10-28 15:36:10 +02:00
parent cd7b0f6045
commit 6f28598e6f
3 changed files with 20 additions and 4 deletions

View file

@ -51,7 +51,8 @@
<!-- Display formatted timestamp in card-footer --> <!-- Display formatted timestamp in card-footer -->
</div> </div>
<div class="card-footer p-0 border-top-0" v-if="message.percent < 100"> <div class="card-footer p-0 border-top-0" v-if="message.percent < 100 || message.status === 'failed'"
>
<div <div
class="progress rounded-0 rounded-bottom" class="progress rounded-0 rounded-bottom"
:style="{ height: '10px' }" :style="{ height: '10px' }"

View file

@ -112,7 +112,7 @@ function saveSettings() {
id="max_retry_attempts" id="max_retry_attempts"
@change="saveSettings" @change="saveSettings"
v-model="settings.max_retry_attempts" v-model="settings.max_retry_attempts"
disabled
> >
<option value="1">1</option> <option value="1">1</option>
<option value="2">2</option> <option value="2">2</option>

View file

@ -202,9 +202,14 @@ export function newMessage(
filename = chatFileName; filename = chatFileName;
} else { } else {
file = ""; file = "";
filetype = "text"; filetype = "";
filename = ""; filename = "";
} }
console.log(file)
console.log(filetype)
console.log(filename)
var file_checksum = ""; //crc32(file).toString(16).toUpperCase(); var file_checksum = ""; //crc32(file).toString(16).toUpperCase();
var message_type = "transmit"; var message_type = "transmit";
var command = "msg"; var command = "msg";
@ -549,7 +554,17 @@ export async function updateAllChat(cleanup) {
console.log(item); console.log(item);
databaseUpsert(item.uuid, "status", "failed"); databaseUpsert(item.uuid, "status", "failed");
updateUnsortedChatListEntry(item.uuid, "status", "failed"); updateUnsortedChatListEntry(item.uuid, "status", "failed");
databaseUpsert(item.uuid, "percent", 0);
updateUnsortedChatListEntry(item.uuid, "percent", 0);
} }
// lets update the message if it is failed. Then its always 0 percent
if (item.status == "failed") {
databaseUpsert(item.uuid, "percent", 0);
updateUnsortedChatListEntry(item.uuid, "percent", 0);
databaseUpsert(item.uuid, "bytesperminute", 0);
updateUnsortedChatListEntry(item.uuid, "bytesperminute", 0);
}
} }
} }
}) })
@ -875,7 +890,7 @@ export function requestMessageInfo(id) {
// id and uuid are the same // id and uuid are the same
var data = getFromUnsortedChatListByUUID(id); var data = getFromUnsortedChatListByUUID(id);
chat.selectedMessageObject = data; chat.selectedMessageObject = data;
console.log(data)
if ( if (
typeof data["speed_list"] !== "undefined" && typeof data["speed_list"] !== "undefined" &&
data["speed_list"].length > 0 data["speed_list"].length > 0