d9ebc8ace0
If page refreshes and view transitions clash for us, they'll clash for all. cc: @jorgemanrubia
18 lines
374 B
Ruby
18 lines
374 B
Ruby
# FIXME: Upstream this fix to turbo-rails
|
|
module ViewTransitions
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
before_action :disable_view_transitions, if: :page_refresh?
|
|
end
|
|
|
|
private
|
|
def disable_view_transitions
|
|
@disable_view_transition = true
|
|
end
|
|
|
|
def page_refresh?
|
|
request.referrer.present? && request.referrer == request.url
|
|
end
|
|
end
|