diff --git a/app/views/authorities/show.html.erb b/app/views/authorities/show.html.erb index 4819d6b7e..6e57e503d 100644 --- a/app/views/authorities/show.html.erb +++ b/app/views/authorities/show.html.erb @@ -6,7 +6,8 @@ Information on <%= @authority.full_name %> <% end %> -<% if @authority.boundary && Flipper.enabled?(:show_authority_map, current_user) %> +<%# calling Authority#boundary is slow so putting it after the feature flag check %> +<% if Flipper.enabled?(:show_authority_map, current_user) && @authority.boundary %> <%# TODO: Probably want to precompute the bounding box when the boundary data is loaded instead %>