Wait to load until currentUser returns

This commit is contained in:
Matthew Dillon 2015-07-10 10:31:07 -08:00
parent eb1a8bb6e3
commit e36d327f36
12 changed files with 85 additions and 84 deletions

View file

@ -7,17 +7,17 @@ export default Ember.Controller.extend({
if (strain.get('isDirty')) {
strain.save().then((strain) => {
this.transitionToRoute('strains.show', strain);
this.transitionToRoute('protected.strains.show', strain);
}, (err) => {
this.get('flashMessages').error(err.responseJSON.error);
});
} else {
this.transitionToRoute('strains.index');
this.transitionToRoute('protected.strains.index');
}
},
cancel: function() {
this.transitionToRoute('strains.index');
this.transitionToRoute('protected.strains.index');
},
},