diff --git a/freedata_gui/src/components/chat.vue b/freedata_gui/src/components/chat.vue index e6ed0b97..fbe00398 100644 --- a/freedata_gui/src/components/chat.vue +++ b/freedata_gui/src/components/chat.vue @@ -6,7 +6,9 @@ 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 { getStationInfoByCallsign } from "./../js/stationHandler"; + + import { setActivePinia } from "pinia"; import pinia from "../store/index"; @@ -118,67 +120,10 @@ watch( }, ); -const stationInfo = ref({ - callsign: "N/A", // Default value for callsign - location: { - 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); - } -}