Don't save duplicate queries in Spinner.

This commit is contained in:
Greyson Parrelli 2024-03-20 16:16:31 -04:00 committed by Nicholas Tinsley
parent 6854f7eb2a
commit 27812bb1ec

View file

@ -148,9 +148,15 @@
function onQuerySubmitted() {
const query = editor.getValue();
document.getElementById('query').value = query
document.getElementById('query').value = query;
let history = getQueryHistory();
if (history.length > 0 && history[0] === query) {
console.log('Query already at the top of the history, not saving.');
return;
}
history.unshift(query);
history = history.slice(0, 25);