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
1 changed files with 5 additions and 2 deletions

View File

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