diff --git a/popup.js b/popup.js index 135cecc..32f8bd9 100644 --- a/popup.js +++ b/popup.js @@ -5,6 +5,7 @@ const notify = new Notify(document.querySelector('#notify')); var resultList = document.getElementById('resultList'); var searchInput = document.getElementById('vault-search'); var searchRegex, vaultServerAdress, vaultToken, secretList; +let searchKickoff; async function mainLoaded() { var tabs = await browser.tabs.query({ active: true, currentWindow: true }); @@ -95,8 +96,11 @@ async function querySecrets(searchString, manualSearch) { } const searchHandler = function (e) { + clearTimeout(searchKickoff); if (e.key === 'Enter') { mainLoaded() + } else { + searchKickoff = setTimeout(() => mainLoaded(), 1000); } };