From 3166f89ec4f0667c2f1cef1357d83afcce7e3786 Mon Sep 17 00:00:00 2001 From: syeopite Date: Sat, 26 Jun 2021 15:09:48 -0700 Subject: [PATCH] Remove page param when applying filters --- .../views/components/search-filters/search-filters.ecr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/invidious/views/components/search-filters/search-filters.ecr b/src/invidious/views/components/search-filters/search-filters.ecr index 7b1048cc..1d78bfa2 100644 --- a/src/invidious/views/components/search-filters/search-filters.ecr +++ b/src/invidious/views/components/search-filters/search-filters.ecr @@ -7,9 +7,10 @@
<% # Grabs all search filters. This is to make sure we don't accidently overwrite something within the - # search query later on. + # search query later on. We're also going to remove the page attribute here as we'll want to start on page 1 + #when applying a filter -%> - <% filter_params = env.request.query_params.to_s.gsub(/q=.+?(?=&|$)/, "") %> + <% filter_params = env.request.query_params.to_s.gsub(/q=.+?(?=&|$)/, "").gsub(/&page=\d+/, "") %> <% base_url = "/search?q=#{HTML.escape(query.not_nil!)}" -%> <% filters = ["hour", "today", "week", "month", "year"] %>