Skip to content

Commit

Permalink
if any of the versions in the url are snapshots, enable snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Paul-R committed Nov 27, 2022
1 parent f900f88 commit b6ad282
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/ts/mod_search_logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ function init() {
});
}
const snapshotRegex = /[a-z]/i;
initVersionsMultiselect(versions.filter(v => !snapshotRegex.test(v[0])));
const anyAreSnapshots = (versionsToTest: [string, number][]) =>
versionsToTest.some(v => !snapshotRegex.test(v[0]))
initVersionsMultiselect(
anyAreSnapshots(currentSelectedVersions)
? versions
: versions.filter(v => !snapshotRegex.test(v[0])));

showSnapshotsCheckbox.addEventListener('change', (e) => {
const shouldShowSnapshots = (e.target as HTMLInputElement).checked;
Expand Down

0 comments on commit b6ad282

Please sign in to comment.