mirror of
https://github.com/funamitech/mastodon
synced 2024-11-24 15:16:33 +09:00
Fix unnecessary SQL query performed on unauthenticated requests (#11179)
This commit is contained in:
parent
8d57795608
commit
6836587117
@ -91,11 +91,15 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def current_account
|
||||
@current_account ||= current_user.try(:account)
|
||||
return @current_account if defined?(@current_account)
|
||||
|
||||
@current_account = current_user&.account
|
||||
end
|
||||
|
||||
def current_session
|
||||
@current_session ||= SessionActivation.find_by(session_id: cookies.signed['_session_id'])
|
||||
return @current_session if defined?(@current_session)
|
||||
|
||||
@current_session = SessionActivation.find_by(session_id: cookies.signed['_session_id']) if cookies.signed['_session_id'].present?
|
||||
end
|
||||
|
||||
def current_theme
|
||||
|
Loading…
Reference in New Issue
Block a user