FIX: Duplicated custom badges in AdminBadgesController.

This commit is contained in:
Guo Xiang Tan 2015-11-02 13:13:17 +08:00
parent 48ef609003
commit 30bddd1112

View file

@ -68,7 +68,8 @@ export default Ember.Controller.extend(BufferedContent, {
model = this.get('model');
this.get('model').save(data).then(function() {
if (newBadge) {
self.get('controllers.admin-badges').pushObject(model);
var adminBadgesController = self.get('controllers.admin-badges');
if (!adminBadgesController.contains(model)) adminBadgesController.pushObject(model);
self.transitionToRoute('adminBadges.show', model.get('id'));
} else {
self.commitBuffer();