mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Don't save duplicate queries in Spinner.
This commit is contained in:
committed by
Nicholas Tinsley
parent
6854f7eb2a
commit
27812bb1ec
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user