check if model exists when cancelling ssh key

This commit is contained in:
Piotr Sarnacki 2015-02-10 11:56:33 +01:00
parent 81911777da
commit 15415999c2

View File

@ -53,11 +53,10 @@ Controller = Ember.ObjectController.extend Validations,
@set('model', null) @set('model', null)
cancel: -> cancel: ->
model = @get('model') if model = @get('model')
console.log model.get('currentState.stateName') if model.get('currentState.stateName') == 'root.empty' ||
if model.get('currentState.stateName') == 'root.empty' || model.get('currentState.stateName').indexOf('root.loaded.created') != -1
model.get('currentState.stateName').indexOf('root.loaded.created') != -1 @store.dematerializeRecord(model)
@store.dematerializeRecord(model)
@set('model', null) @set('model', null)
@set('isEditing', false) @set('isEditing', false)