Fix resetting lastHeard on stations

This commit is contained in:
Adam Goldsmith 2018-07-11 21:48:45 -04:00
parent aa9a676806
commit 1a85f4f0d6

View File

@ -60,15 +60,13 @@ aprsStream.onmessage = function(event) {
messages.push(message); messages.push(message);
if (!(callsign in stations)) { if (!(callsign in stations)) {
stations[callsign] = { stations[callsign] = {};
lastHeard: date,
};
} }
else { else {
window.clearTimeout(stations[callsign].timeout); window.clearTimeout(stations[callsign].timeout);
} }
stations[callsign].lastHeard = date;
stations[callsign].delta = date - stations[callsign].lastHeard; stations[callsign].delta = date - stations[callsign].lastHeard;
stations[callsign].timeout = window.setTimeout( stations[callsign].timeout = window.setTimeout(
alertNotHeard, timeoutLength, callsign); alertNotHeard, timeoutLength, callsign);