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)
|
@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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user