Skip to content

Commit

Permalink
Don't query for the rss feed for a non logged user
Browse files Browse the repository at this point in the history
There is no need to retrieve the RSS token for a non logged user. It
isn't defined. This prevents querying the database on each page request
for an anonymous user.

Co-authored-by: David Kang <dkang@suse.com>
  • Loading branch information
eduardoj and David Kang committed May 11, 2020
1 parent 0708dc9 commit 462c9ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/views/layouts/webui/webui.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

= auto_discovery_link_tag(:rss, news_feed_path(format: 'rss'), title: 'News')
= csrf_meta_tag
- if User.possibly_nobody.rss_token
- if User.session.try(:rss_token)
= auto_discovery_link_tag(:rss, user_rss_notifications_url(token: User.session!.rss_token.string, format: :rss), title: 'Notifications')
= auto_discovery_link_tag(:rss, latest_updates_feed_path(format: 'rss'), title: 'Latest updates')
%body.d-flex.flex-column{ class: "#{'responsive-ux' if flipper_responsive?}" }
Expand Down

0 comments on commit 462c9ef

Please sign in to comment.