Skip to content

Commit 3cc59ec

Browse files
committed
stop default toggles from showing up in url
1 parent 6a987f7 commit 3cc59ec

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

devops/scripts/benchmarks/html/scripts.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,17 @@ function updateURL() {
475475
}
476476

477477
// Add toggle states to URL
478-
url.searchParams.set('notes', isNotesEnabled());
479-
url.searchParams.set('unstable', isUnstableEnabled());
478+
if (isNotesEnabled()) {
479+
url.searchParams.delete('notes');
480+
} else {
481+
url.searchParams.set('notes', 'false');
482+
}
483+
484+
if (!isUnstableEnabled()) {
485+
url.searchParams.delete('unstable');
486+
} else {
487+
url.searchParams.set('unstable', 'true');
488+
}
480489

481490
history.replaceState(null, '', url);
482491
}
@@ -754,6 +763,7 @@ function setupToggles() {
754763
document.querySelectorAll('.benchmark-note').forEach(note => {
755764
note.style.display = isNotesEnabled() ? 'block' : 'none';
756765
});
766+
updateURL();
757767
});
758768

759769
unstableToggle.addEventListener('change', function() {

0 commit comments

Comments
 (0)