Skip to content

Commit

Permalink
fix: Reported issue with initialization of variable 'searchInput' occ…
Browse files Browse the repository at this point in the history
…asionally
  • Loading branch information
gebederry committed Jul 28, 2024
1 parent e097de8 commit 2597ce3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2597ce3

Please sign in to comment.