FIX: Wait for loading to show out of endorsements (#42)

FIX: Wait for loading to show out of endorsements (#42)

diff --git a/assets/javascripts/discourse/templates/components/endorsement-checkboxes.hbs b/assets/javascripts/discourse/templates/components/endorsement-checkboxes.hbs
index 941b22e..9ecbbf4 100644
--- a/assets/javascripts/discourse/templates/components/endorsement-checkboxes.hbs
+++ b/assets/javascripts/discourse/templates/components/endorsement-checkboxes.hbs
@@ -27,21 +27,23 @@
 {{/d-modal-body}}
 
 <div class="modal-footer">
-  {{#if outOfEndorsements}}
-    <div class="alert alert-danger out-of-endorsements-alert">
-      {{i18n "category_experts.out_of_endorsements"}}
-    </div>
-  {{else}}
-    {{d-button
-      class="btn-primary category-endorsement-save"
-      action=(action "save")
-      disabled=saveDisabled
-      label="category_experts.endorse"
-    }}
-    {{#unless currentUser.staff}}
-      <div class="remaining-endorsements-notice">
-        {{i18n "category_experts.remaining_endorsements" count=remainingEndorsements}}
+  {{#unless loading}}
+    {{#if outOfEndorsements}}
+      <div class="alert alert-danger out-of-endorsements-alert">
+        {{i18n "category_experts.out_of_endorsements"}}
       </div>
-    {{/unless}}
-  {{/if}}
+    {{else}}
+      {{d-button
+        class="btn-primary category-endorsement-save"
+        action=(action "save")
+        disabled=saveDisabled
+        label="category_experts.endorse"
+      }}
+      {{#unless currentUser.staff}}
+        <div class="remaining-endorsements-notice">
+          {{i18n "category_experts.remaining_endorsements" count=remainingEndorsements}}
+        </div>
+      {{/unless}}
+    {{/if}}
+  {{/unless}}
 </div>

GitHub sha: cb4a309a256b5aae94a2cda6531591319175c3a5

This commit appears in #42 which was approved by pmusaraj. It was merged by markvanlan.