diff --git a/assets/js/offline-search.js b/assets/js/offline-search.js index d6bec0bf..7644702f 100644 --- a/assets/js/offline-search.js +++ b/assets/js/offline-search.js @@ -61,24 +61,13 @@ // // Dispose existing popover // - - { - let popover = bootstrap.Popover.getInstance($targetSearchInput[0]); - if (popover !== null) { - popover.dispose(); - } - } - + bootstrap.Popover.getInstance($targetSearchInput[0])?.dispose(); // // Search // - - if (idx === null) { - return; - } - const searchQuery = $targetSearchInput.val(); - if (searchQuery === "") { + + if (idx === null || searchQuery === "") { return; }