Commit 00312902 authored by Ash McKenzie's avatar Ash McKenzie

Check user_default_dashboard? first

Check user_default_dashboard? before show_gold_trial? as it's less
resource intensive.
parent 16313c55
......@@ -22,7 +22,9 @@ module EE
end
def user_default_dashboard?(user = current_user)
controller_action_to_child_dashboards.any? {|dashboard| dashboard == user.dashboard }
return false unless user
controller_action_to_child_dashboards.any? { |dashboard| dashboard == user.dashboard }
end
end
end
- if show_gold_trial? && user_default_dashboard?
- if user_default_dashboard? && show_gold_trial?
.pt-1.d-none.d-md-block{ class: container_class }
.user-callout.promotion-callout.thin-callout.js-gold-trial-callout{ data: { uid: 'trial_callout_dismissed', feature_id: UserCalloutsHelper::GOLD_TRIAL, dismiss_endpoint: user_callouts_path } }
.bordered-box.justify-content-left.align-items-center
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment