Wait to load until currentUser returns
This commit is contained in:
parent
eb1a8bb6e3
commit
e36d327f36
12 changed files with 85 additions and 84 deletions
|
@ -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');
|
||||
},
|
||||
|
||||
},
|
||||
|
|
Reference in a new issue