From 2597ce39f88530416b6f0f756cfd3a29916682bd Mon Sep 17 00:00:00 2001 From: gebederry Date: Sun, 28 Jul 2024 16:51:06 +0800 Subject: [PATCH] fix: Reported issue with initialization of variable 'searchInput' occasionally --- assets/js/scripts.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/js/scripts.js b/assets/js/scripts.js index 2ecd866d7..c04bbe42b 100644 --- a/assets/js/scripts.js +++ b/assets/js/scripts.js @@ -1268,17 +1268,18 @@ function filterMapMarkers() { uniqueSearchMarkers = []; let filterType = () => true; let enableMainCategory = true; + const searchInputVal = document.getElementById('search').value; if (Settings.filterType === 'none') { const searchSet = new Set( - (searchInput.value || '') + (searchInputVal || '') .replace(/^[;\s]+|[;\s]+$/g, '') .split(';') .filter(Boolean) ); if (searchSet.size) - MapBase.onSearch(searchInput.value, true); + MapBase.onSearch(searchInputVal, true); else uniqueSearchMarkers = MapBase.markers;