Skip to content

Commit 3a3f5cf

Browse files
don't mark vehicle as updated on duplicat packet
1 parent d73ccdb commit 3a3f5cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/tracker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,10 @@ function addPosition(position) {
19151915
else if(wvar.mode == "Position") { // we don't splice old postions in latest position mode
19161916
return;
19171917
}
1918-
else if(vehicle.positions_ts.indexOf(new_ts) == -1) { // backlog packets, need to splice them into the array
1918+
else {
1919+
if(vehicle.positions_ts.indexOf(new_ts) > -1) return; // duplicate packet
1920+
1921+
// backlog packets, need to splice them into the array
19191922
// find out the index at which we should insert the new point
19201923
var xref = vehicle.positions_ts;
19211924
var idx = -1, len = xref.length;

0 commit comments

Comments
 (0)