Skip to content

Commit

Permalink
fix: close entity management window when add/edit fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmacdonald committed Oct 16, 2018
1 parent 58747c4 commit 3ae029b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,16 +508,16 @@ function initialize(entityType, entityLookupMethodName, entityLookupTitle, searc
channel = new BroadcastChannel('cwrc-entity-management-forms')
channel.onmessage = (id) => {
if (id === undefined) {
// add/edit failed so do nothing
// add/edit failed so don't return result
} else {
const uri = entitySources[currentSearchOptions.entityType].get('cwrc').getEntityRoot()+'/'+id
returnResult({
id,
uri,
repository: 'cwrc'
})
entityFormWindow.close()
}
entityFormWindow.close() // always close window
}

selectedResult = undefined
Expand Down

0 comments on commit 3ae029b

Please sign in to comment.