Fix re-requesting package search when current params from initial query

This commit is contained in:
Martchus 2022-04-17 14:04:06 +02:00
parent 4578b30ea2
commit 8465b620d1
1 changed files with 4 additions and 1 deletions

View File

@ -24,7 +24,10 @@ export function initPackageSearch(sectionElement, sectionData, newParams)
}; };
searchForm.dataset.initialized = true; searchForm.dataset.initialized = true;
} }
const currentParams = sectionData.state.params; let currentParams = sectionData.state.params;
if (currentParams && currentParams.startsWith('?')) {
currentParams = currentParams.substr(1);
}
const hasNewParams = newParams.length >= 1; const hasNewParams = newParams.length >= 1;
if (!hasNewParams) { if (!hasNewParams) {
if (currentParams !== undefined) { if (currentParams !== undefined) {