mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
possible fix of stuck file input
This commit is contained in:
parent
8be087e4fc
commit
c33d23f326
|
@ -77,6 +77,11 @@ function handleFileSelection(event) {
|
|||
|
||||
function removeFile(index) {
|
||||
selectedFiles.value.splice(index, 1);
|
||||
// Check if the selectedFiles array is empty
|
||||
if (selectedFiles.value.length === 0) {
|
||||
// Reset the file input if there are no files left
|
||||
resetFile();
|
||||
}
|
||||
}
|
||||
|
||||
function transmitNewMessage() {
|
||||
|
@ -118,11 +123,11 @@ function transmitNewMessage() {
|
|||
}
|
||||
|
||||
function resetFile(event){
|
||||
//fileInput.reset()
|
||||
fileInput.value = null
|
||||
if (fileInput.value) {
|
||||
fileInput.value.value = ''; // Reset the file input
|
||||
}
|
||||
// Clear the selected files array to reset the state of attachments
|
||||
selectedFiles.value = [];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ interface Message {
|
|||
}
|
||||
|
||||
export async function processFreedataMessages(data) {
|
||||
if (typeof data != "undefined") {
|
||||
if (typeof data !== "undefined" && typeof data.messages !== "undefined" && Array.isArray(data.messages)) {
|
||||
chatStore.callsign_list = createCallsignListFromAPI(data);
|
||||
chatStore.sorted_chat_list = createSortedMessagesList(data);
|
||||
}
|
||||
|
@ -38,9 +38,7 @@ function createCallsignListFromAPI(data: {
|
|||
}): { [key: string]: { timestamp: string; body: string } } {
|
||||
const callsignList: { [key: string]: { timestamp: string; body: string } } =
|
||||
{};
|
||||
if (typeof data == "undefined") {
|
||||
return callsignList;
|
||||
}
|
||||
|
||||
data.messages.forEach((message) => {
|
||||
let callsign =
|
||||
message.direction === "receive" ? message.origin : message.destination;
|
||||
|
|
Loading…
Reference in a new issue