check fragment is the right form before using it as filters

This commit is contained in:
Rhiannon Morris 2021-08-18 05:10:26 +02:00
parent 47fff05d48
commit e47b790242

View file

@ -100,8 +100,11 @@ function useFragment() {
clearForm(); clearForm();
} else { } else {
let set = new Set(frag.split(';')); let set = new Set(frag.split(';'));
if (new Array(...set).every(x => /^(require|exclude)_/.test(x))) {
allBoxes.forEach(b => b.checked = set.has(b.id)); allBoxes.forEach(b => b.checked = set.has(b.id));
document.getElementById('filters-details').open = true; let details = document.getElementById('filters-details');
details.open = !set.has('hide_filters');
}
} }
updateItems(); updateItems();