Skip to content

Commit

Permalink
More robust checking on the About screen of the GraphQL rate limit in…
Browse files Browse the repository at this point in the history
…formation being nil
  • Loading branch information
johntopleyons committed Jul 21, 2023
1 parent aa74825 commit 1897780
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion webapp/views/about.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
</ul>
</nav>

<p><%= rate_limit.class %></p>
<% unless rate_limit.is_a?(NilClass) || rate_limit.nil? %>
<section id="rate-limit">
<h3>GitHub GraphQL API Rate Limit</h3>
<p><%=pluralise(rate_limit.remaining, 'point', 'points') %> remaining out of <%=pluralise(rate_limit.limit, 'point', 'points') %> limit</p>
<p>Resets <%=d rate_limit.reset_at %></p>
</section>
<% end %>
<section id="version-info">
<h3>Version Information</h3>
<p>Branch: <a href="https://github.com/ONSdigital/<%=h repo_name%>/tree/<%=h branch %>"><%=h branch %></a></p>
Expand Down

0 comments on commit 1897780

Please sign in to comment.