mirror of
https://github.com/iv-org/invidious.git
synced 2024-09-10 19:42:39 +00:00
Redirect to home page on empty search
This commit is contained in:
parent
0832fa9bdb
commit
2fdf3d24e3
@ -588,6 +588,10 @@ get "/search" do |env|
|
|||||||
query ||= env.params.query["q"]?
|
query ||= env.params.query["q"]?
|
||||||
query ||= ""
|
query ||= ""
|
||||||
|
|
||||||
|
if query.empty?
|
||||||
|
next env.redirect "/"
|
||||||
|
end
|
||||||
|
|
||||||
page = env.params.query["page"]?.try &.to_i?
|
page = env.params.query["page"]?.try &.to_i?
|
||||||
page ||= 1
|
page ||= 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user