Fix infinite loading spinner for badges that have not been granted yet.

This commit is contained in:
Vikhyat Korrapati 2014-04-18 09:10:18 +05:30
parent 8113e8d897
commit e6eb16ee73
2 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,7 @@ Discourse.BadgesShowRoute = Ember.Route.extend({
setupController: function(controller, model) {
Discourse.UserBadge.findByBadgeId(model.get('id')).then(function(userBadges) {
controller.set('userBadges', userBadges);
controller.set('userBadgesLoaded', true);
});
controller.set('model', model);
}

View File

@ -22,6 +22,8 @@
{{/link-to}}
{{/each}}
{{else}}
<div class='spinner'>{{i18n loading}}</div>
{{#unless userBadgesLoaded}}
<div class='spinner'>{{i18n loading}}</div>
{{/unless}}
{{/if}}
</div>