Don't save duplicate queries in Spinner.
This commit is contained in:
parent
6854f7eb2a
commit
27812bb1ec
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue