From ef2d191fc0566fed0214532d1eca0c9e630461e1 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Wed, 23 Aug 2023 01:41:52 +0530 Subject: [PATCH] UX improvement --- index.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index c327c92..3c586e7 100644 --- a/index.html +++ b/index.html @@ -1944,13 +1944,17 @@ }) } - function processNavbarSearch() { + async function processNavbarSearch() { const query = getRef('main_search_field').value.trim(); - if (query === '') return - categorizeText(query).then(() => { + try { + await getAllSuggestions(); + if (query === '') return + await categorizeText(query) getRef('main_search_field').value = '' renderElem(getRef('suggestions'), html``) - }) + } catch (err) { + console.error(err) + } } async function getAllSuggestions() {