diff --git a/www/assets/js/toolbox_track.js b/www/assets/js/toolbox_track.js index c804d74..5ab25a9 100644 --- a/www/assets/js/toolbox_track.js +++ b/www/assets/js/toolbox_track.js @@ -94,7 +94,14 @@ function openTrackingHistory(code) { } else { history = JSON.parse(history); } - if (infocontext.code != "" && !history.includes(infocontext.code)) { + if (infocontext.code != "") { + // Search the history list and remove the current code if it's there + for (var i = 0; i < history.length; i++) { + if (history[i] == infocontext.code) { + history.splice(i, 1); + } + } + // Add the code back to the list so it's at the top history.push(infocontext.code); } while (history.length > 5) {