diff --git a/server/src/server.js b/server/src/server.js index 42ee5a4..4cae2d0 100644 --- a/server/src/server.js +++ b/server/src/server.js @@ -54,5 +54,6 @@ wss.on('connection', (ws) => { .split('\n') .filter((line) => line !== '') .forEach((line) => ws.send(line)); + ws.send("FINISHED REPLAY"); } }); diff --git a/src/StationRow.vue b/src/StationRow.vue index 8703620..0d07cd2 100644 --- a/src/StationRow.vue +++ b/src/StationRow.vue @@ -30,12 +30,15 @@ const props = defineProps({ tactical: String, timeoutLength: Number, lowVoltage: Number, + finishedReplay: Boolean, messages: Array, now: Date, }); function notify(title, body) { - return new Notification(title, { body: body, requireInteraction: true }); + if (props.finishedReplay) { + return new Notification(title, { body: body, requireInteraction: true }); + } } function formatTime(time, isDuration = false) { diff --git a/src/StatusScreen.vue b/src/StatusScreen.vue index d508e3e..6445c14 100644 --- a/src/StatusScreen.vue +++ b/src/StatusScreen.vue @@ -27,6 +27,7 @@ :tactical="tactical" :lowVoltage="config.lowVoltage" :timeoutLength="parseDuration(config.timeoutLength)" + :finishedReplay="finishedReplay" :messages="messagesFromStation[callsign] || []" :now="now" > @@ -45,6 +46,7 @@ import config from './status_config.yaml'; const parser = new APRSParser(); let aprsStream = null; +const finishedReplay = ref(false); const messages = ref([]); const messagesFromStation = ref({}); const now = ref(new Date()); @@ -69,7 +71,9 @@ function connectToStream() { }, 5000); }; aprsStream.onmessage = (event) => { - if (event.data !== '') { + if (event.data === 'FINISHED REPLAY') { + finishedReplay.value = true; + } else if (event.data !== '') { handleMessage(JSON.parse(event.data)); } };