From a0e8c47a6f99c47c2f97e6ea6c2f17dc0d657576 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 3 Jul 2024 02:31:10 +0000 Subject: [PATCH] don't reset tab to default when you search from a non default tab --- config-default.toml | 3 +++ src/web/search.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/config-default.toml b/config-default.toml index 0a75fb6..ded0b7e 100644 --- a/config-default.toml +++ b/config-default.toml @@ -8,6 +8,9 @@ api = false # show_version_info = true # stylesheet_url = "/themes/catppuccin-mocha.css" +[image_search] +# enabled = true + [engines] # numbat = false # fend = true diff --git a/src/web/search.rs b/src/web/search.rs index 059e04b..d18377f 100644 --- a/src/web/search.rs +++ b/src/web/search.rs @@ -27,6 +27,9 @@ fn render_beginning_of_html(search: &SearchQuery) -> String { let form_html = html! { form."search-form" action="/search" method="get" { input #"search-input" type="text" name="q" placeholder="Search" value=(search.query) autofocus onfocus="this.select()" autocomplete="off"; + @if search.tab != SearchTab::default() { + input type="hidden" name="tab" value=(search.tab.to_string()); + } input type="submit" value="Search"; } @if search.config.image_search.enabled {