diff --git a/htdocs/lib/Js8Threads.js b/htdocs/lib/Js8Threads.js index 12997a6..d665b10 100644 --- a/htdocs/lib/Js8Threads.js +++ b/htdocs/lib/Js8Threads.js @@ -96,6 +96,9 @@ Js8Threader.prototype.findThread = function(freq) { // max frequency deviation: 5 Hz. this may be a little tight. return thread.isOpen() && Math.abs(thread.getAverageFrequency() - freq) <= 5; }); + matching.sort(function(a, b){ + return b.getLatestTimestamp() - a.getLatestTimestamp(); + }); return matching[0] || false; };