Skip to content

Commit

Permalink
Merge pull request #3143 from projectblacklight/avoid-prefetch
Browse files Browse the repository at this point in the history
Avoid Turbo prefetching (InstantClick)
  • Loading branch information
tpendragon committed Feb 15, 2024
2 parents 1d3c74f + e4d3357 commit ebdd658
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/helpers/blacklight/url_helper_behavior.rb
Expand Up @@ -36,7 +36,8 @@ def document_link_params(doc, opts)
private :document_link_params

##
# Attributes for a link that gives a URL we can use to track clicks for the current search session
# Attributes for a link that gives a URL we can use to track clicks for the current search session.
# We disable turbo prefetch (InstantClick), because since we replace the link with a form, it's just wasted.
# @param [SolrDocument] document
# @param [Integer] counter
# @example
Expand All @@ -52,7 +53,7 @@ def session_tracking_params document, counter, per_page: search_session['per_pag
return {} if path.nil?

context_method = blacklight_config.track_search_session.storage == 'client' ? 'get' : 'post'
{ data: { context_href: path, context_method: context_method } }
{ data: { context_href: path, context_method: context_method, turbo_prefetch: false } }
end

##
Expand Down

0 comments on commit ebdd658

Please sign in to comment.