summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Jankowski <matt@jankowski.online>2023-11-28 03:19:08 -0500
committerGitHub <noreply@github.com>2023-11-28 08:19:08 +0000
commit9072896ae57c75550c83ad1ec4df7970d9b59045 (patch)
treeb421a75e92957da29bceb2fa697ca2d73fd5201e
parentdfc7154767443a21e82531ddfb56c2fc8fb95dda (diff)
Avoid unnecessary i-var for account rss page url generation (#28092)
-rw-r--r--app/controllers/accounts_controller.rb3
-rw-r--r--app/views/accounts/show.html.haml2
2 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb
index a34c116a063..b0f97317203 100644
--- a/app/controllers/accounts_controller.rb
+++ b/app/controllers/accounts_controller.rb
@@ -18,8 +18,6 @@ class AccountsController < ApplicationController
respond_to do |format|
format.html do
expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.hour) unless user_signed_in?
-
- @rss_url = rss_url
end
format.rss do
@@ -84,6 +82,7 @@ class AccountsController < ApplicationController
short_account_url(@account, format: 'rss')
end
end
+ helper_method :rss_url
def media_requested?
request.path.split('.').first.end_with?('/media') && !tag_requested?
diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml
index d56f10a7ff3..dde9c508474 100644
--- a/app/views/accounts/show.html.haml
+++ b/app/views/accounts/show.html.haml
@@ -5,7 +5,7 @@
- if @account.user_prefers_noindex?
%meta{ name: 'robots', content: 'noindex, noarchive' }/
- %link{ rel: 'alternate', type: 'application/rss+xml', href: @rss_url }/
+ %link{ rel: 'alternate', type: 'application/rss+xml', href: rss_url }/
%link{ rel: 'alternate', type: 'application/activity+json', href: ActivityPub::TagManager.instance.uri_for(@account) }/
- @account.fields.select(&:verifiable?).each do |field|