From 537f32ab8b05179dec9e11c1bcff28ac3779ab26 Mon Sep 17 00:00:00 2001 From: sto Date: Wed, 16 Jul 2025 10:43:08 +0200 Subject: [PATCH] Don't change browser history on category filter change --- app/views/contests/_category_selector.html.slim | 2 +- app/views/contests/show.html.slim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/contests/_category_selector.html.slim b/app/views/contests/_category_selector.html.slim index 395d3ba..2ac3d2e 100644 --- a/app/views/contests/_category_selector.html.slim +++ b/app/views/contests/_category_selector.html.slim @@ -15,5 +15,5 @@ if (option.value == selectedCategory) option.selected = true; }); categorySelectEl.addEventListener('change', (e) => { - window.location.href = `/public/#{@contest.slug}?category=${e.target.value}` + window.location.replace(`/public/#{@contest.slug}?category=${e.target.value}`); }) \ No newline at end of file diff --git a/app/views/contests/show.html.slim b/app/views/contests/show.html.slim index 98bec3f..a85640d 100644 --- a/app/views/contests/show.html.slim +++ b/app/views/contests/show.html.slim @@ -61,7 +61,7 @@ javascript: if (option.value == selectedCategory) option.selected = true; }); categorySelectEl.addEventListener('change', (e) => { - window.location.href = `#{contest_path(@contest)}?category=${e.target.value}` + window.location.replace(`#{contest_path(@contest)}?category=${e.target.value}`); }) .d-flex.flex-column style="overflow-y: auto" table.table.table-striped.table-hover