check if model exists when cancelling ssh key
This commit is contained in:
parent
81911777da
commit
15415999c2
|
@ -53,11 +53,10 @@ Controller = Ember.ObjectController.extend Validations,
|
|||
@set('model', null)
|
||||
|
||||
cancel: ->
|
||||
model = @get('model')
|
||||
console.log model.get('currentState.stateName')
|
||||
if model.get('currentState.stateName') == 'root.empty' ||
|
||||
model.get('currentState.stateName').indexOf('root.loaded.created') != -1
|
||||
@store.dematerializeRecord(model)
|
||||
if model = @get('model')
|
||||
if model.get('currentState.stateName') == 'root.empty' ||
|
||||
model.get('currentState.stateName').indexOf('root.loaded.created') != -1
|
||||
@store.dematerializeRecord(model)
|
||||
|
||||
@set('model', null)
|
||||
@set('isEditing', false)
|
||||
|
|
Loading…
Reference in New Issue
Block a user