Skip to content

Commit

Permalink
Speed up authority show page
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Sep 12, 2024
1 parent 3e28f23 commit ad171a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/views/authorities/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
Information <span class="block mt-1 text-xl font-bold font-display">on <%= @authority.full_name %></span>
<% 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 %>
<div class="w-full my-8 h-80 bg-google-maps-green"
x-init="initialiseAuthorityMap($el, <%= bb = RGeo::Cartesian::BoundingBox.create_from_geometry(@authority.boundary)
Expand Down

0 comments on commit ad171a7

Please sign in to comment.