mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: double XHR request when loading more badges
This commit is contained in:
parent
418bc4a844
commit
7ab153dac3
1 changed files with 7 additions and 0 deletions
|
@ -21,6 +21,11 @@ export default Ember.Controller.extend({
|
|||
|
||||
actions: {
|
||||
loadMore() {
|
||||
if (this.get('loadingMore')) {
|
||||
return;
|
||||
}
|
||||
this.set('loadingMore', true);
|
||||
|
||||
const userBadges = this.get('userBadges');
|
||||
|
||||
UserBadge.findByBadgeId(this.get('model.id'), {
|
||||
|
@ -31,6 +36,8 @@ export default Ember.Controller.extend({
|
|||
if (userBadges.length === 0){
|
||||
this.set('noMoreBadges', true);
|
||||
}
|
||||
}).finally(()=>{
|
||||
this.set('loadingMore', false);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue