Skip to content

Commit

Permalink
🐛 Handle blank query and snippets
Browse files Browse the repository at this point in the history
This commit will address blank catalog searches and how it interacts
with snippets.  Prior, when the user submitted a blank catalog search,
the entire indexed text will be returned.  This is not desired because
if we're looking at a book with a hundred pages, then that's a lot of
rendered text.  Instead, if we don't have a query string then we will
also return.
  • Loading branch information
kirkkwang committed Sep 18, 2024
1 parent 3a14e3a commit 5717545
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/iiif_print/iiif_print_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module IiifPrint::IiifPrintHelperBehavior
# rubocop:disable Rails/OutputSafety
def render_ocr_snippets(options = {})
snippets = options[:value]
return if snippets.blank?
return if snippets.blank? || params[:q].blank?

snippets_content = [content_tag('div',
"... #{snippets.first} ...".html_safe,
Expand Down

0 comments on commit 5717545

Please sign in to comment.