From 952e0523212901fc9db8a5836566dc08050d8cac Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Fri, 10 Jul 2020 15:18:38 -0500 Subject: [PATCH] Updated react.html.haml to not preload home_timeline, notifications if no current_user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated: - react.html.haml to not preload home_timeline, notifications if no current_user --- app/views/react/react.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/react/react.html.haml b/app/views/react/react.html.haml index 1044c773..ac6493a1 100644 --- a/app/views/react/react.html.haml +++ b/app/views/react/react.html.haml @@ -1,6 +1,7 @@ - content_for :header_tags do - = preload_link_tag asset_pack_path('features/home_timeline.js'), crossorigin: 'anonymous' - = preload_link_tag asset_pack_path('features/notifications.js'), crossorigin: 'anonymous' + - if @current_user + = preload_link_tag asset_pack_path('features/home_timeline.js'), crossorigin: 'anonymous' + = preload_link_tag asset_pack_path('features/notifications.js'), crossorigin: 'anonymous' %meta{name: 'applicationServerKey', content: Rails.configuration.x.vapid_public_key} %script#initial-state{ type: 'application/json' }!= json_escape(@initial_state_json)