Merge pull request #2567 from basecamp/mobile/fix-empty-search

This commit is contained in:
Adrien Maston
2026-02-19 14:28:54 +01:00
committed by GitHub
4 changed files with 12 additions and 6 deletions
+4 -2
View File
@@ -2,10 +2,12 @@ class SearchesController < ApplicationController
include Turbo::DriveHelper
def show
if card = Current.user.accessible_cards.find_by_id(params[:q])
@query = params[:q].blank? ? nil : params[:q]
if card = Current.user.accessible_cards.find_by_id(@query)
@card = card
else
set_page_and_extract_portion_from Current.user.search(params[:q])
set_page_and_extract_portion_from Current.user.search(@query)
@recent_search_queries = Current.user.search_queries.order(updated_at: :desc).limit(10)
end
end