[CodeFactor] Apply fixes

This commit is contained in:
codefactor-io 2024-05-01 10:38:28 +00:00
parent 38427429dd
commit efff46b4eb
No known key found for this signature in database
GPG key ID: B66B2D63282C190F
4 changed files with 75 additions and 87 deletions

View file

@ -119,9 +119,9 @@ watch(
);
const stationInfo = ref({
callsign: 'N/A', // Default value for callsign
callsign: "N/A", // Default value for callsign
location: {
gridsquare: 'N/A', // Default value for gridsquare
gridsquare: "N/A", // Default value for gridsquare
},
});
@ -129,21 +129,18 @@ async function getStationInfoByCallsign(){
try {
const data = await getStationInfo(chat.selectedCallsign);
stationInfo.value = {
callsign: data.callsign || 'N/A', // Default if not present
callsign: data.callsign || "N/A", // Default if not present
location: {
gridsquare: data.location?.gridsquare || 'N/A', // Default if not present
gridsquare: data.location?.gridsquare || "N/A", // Default if not present
},
};
} catch (error) {
console.error("Error fetching station info:", error);
}
}
</script>
<template>
<!-- Station Info Modal -->
<div
class="modal fade"
@ -162,16 +159,12 @@ async function getStationInfoByCallsign(){
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<p><strong>Location:</strong> {{ stationInfo.location.gridsquare }}</p>
<p>
<strong>Location:</strong> {{ stationInfo.location.gridsquare }}
</p>
<p><strong>Details:</strong> {{ stationInfo.details }}</p>
</div>
<div class="modal-footer">
@ -187,18 +180,19 @@ async function getStationInfoByCallsign(){
</div>
</div>
<div class="container-fluid d-flex p-0">
<!-- Chat Conversations -->
<div class="bg-light p-0" style="width: 250px">
<div class="container-fluid overflow-auto p-0">
<chat_conversations />
</div>
<div class="list-group overflow-auto" id="list-tab-chat" role="tablist"></div>
<div
class="list-group overflow-auto"
id="list-tab-chat"
role="tablist"
></div>
</div>
<!-- Chat Messages -->
<div class="flex-grow-1 border-start p-0">
<div class="d-flex flex-column">
@ -213,9 +207,6 @@ async function getStationInfoByCallsign(){
<h4 class="p-0 m-0">{{ chat.selectedCallsign }}</h4>
</button>
<div class="input-group mb-0 p-0 w-25">
<button type="button" class="btn btn-outline-secondary" disabled>
Beacons

View file

@ -35,7 +35,6 @@ function newChat() {
if (callsign === "") return;
this.newChatCall.value = "";
}
</script>
<template>

View file

@ -211,7 +211,6 @@ const transmissionSpeedChartDataMessageInfo = computed(() => ({
</div>
</div>
<!-- Message Info Modal -->
<div
class="modal fade"

View file

@ -34,12 +34,11 @@ export async function processFreedataMessages(data) {
chatStore.callsign_list = createCallsignListFromAPI(data);
chatStore.sorted_chat_list = createSortedMessagesList(data);
console.log(chatStore.sorted_chat_list)
console.log(chatStore.sorted_chat_list);
// also update the selectedCallsign - if its undefined, then we select the first available callsign
if (typeof chatStore.selectedCallsign == "undefined") {
chatStore.selectedCallsign = Object.keys(chatStore.sorted_chat_list)[0]
chatStore.selectedCallsign = Object.keys(chatStore.sorted_chat_list)[0];
}
}
}