]> git.openstreetmap.org Git - rails.git/commitdiff
Remove unnecessary loop when rendering preferred auth provider button
authorAnton Khorev <tony29@yandex.ru>
Wed, 17 Jul 2024 14:47:13 +0000 (17:47 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 17 Jul 2024 14:47:13 +0000 (17:47 +0300)
app/views/application/_auth_providers.html.erb

index 89de3b4ffbf63a19f01ae08f9ce3d523d1d90911..c77a3ed3ee171700a5725e26542e02436e933dd8 100644 (file)
 
     <% if prefered_auth_button_available %>
       <div class="col justify-content-center d-flex align-items-center flex-wrap">
-        <% %w[google facebook microsoft github wikipedia].each do |provider| %>
-          <% if Settings.key?("#{provider}_auth_id".to_sym) -%>
-            <% if @preferred_auth_provider == provider %>
-              <%= auth_button_preferred provider %>
-            <% end %>
-          <% end -%>
-        <% end -%>
+        <%= auth_button_preferred @preferred_auth_provider %>
       </div>
     <% end %>