From efff46b4ebcc6a3b0825f7889d5c70039cee4e4a Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Wed, 1 May 2024 10:38:28 +0000 Subject: [PATCH] [CodeFactor] Apply fixes --- freedata_gui/src/components/chat.vue | 153 +++++++++--------- .../src/components/chat_conversations.vue | 1 - freedata_gui/src/components/main_modals.vue | 1 - freedata_gui/src/js/messagesHandler.ts | 7 +- 4 files changed, 75 insertions(+), 87 deletions(-) diff --git a/freedata_gui/src/components/chat.vue b/freedata_gui/src/components/chat.vue index 5b1be158..4f8588cb 100644 --- a/freedata_gui/src/components/chat.vue +++ b/freedata_gui/src/components/chat.vue @@ -6,7 +6,7 @@ import chat_conversations from "./chat_conversations.vue"; import chat_messages from "./chat_messages.vue"; import chat_new_message from "./chat_new_message.vue"; -import {getStationInfo} from "./../js/api"; +import { getStationInfo } from "./../js/api"; import { setActivePinia } from "pinia"; import pinia from "../store/index"; @@ -119,33 +119,30 @@ 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 }, }); -async function getStationInfoByCallsign(){ - try { - const data = await getStationInfo(chat.selectedCallsign); - stationInfo.value = { - callsign: data.callsign || 'N/A', // Default if not present - location: { - gridsquare: data.location?.gridsquare || 'N/A', // Default if not present - }, - }; - } catch (error) { - console.error("Error fetching station info:", error); - } +async function getStationInfoByCallsign() { + try { + const data = await getStationInfo(chat.selectedCallsign); + stationInfo.value = { + callsign: data.callsign || "N/A", // Default if not present + location: { + gridsquare: data.location?.gridsquare || "N/A", // Default if not present + }, + }; + } catch (error) { + console.error("Error fetching station info:", error); + } } - - diff --git a/freedata_gui/src/components/chat_conversations.vue b/freedata_gui/src/components/chat_conversations.vue index 146dd68d..4e6d7111 100644 --- a/freedata_gui/src/components/chat_conversations.vue +++ b/freedata_gui/src/components/chat_conversations.vue @@ -35,7 +35,6 @@ function newChat() { if (callsign === "") return; this.newChatCall.value = ""; } -