Skip to content

Commit

Permalink
fix: take no action when entity management form returns undefined id
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmacdonald committed Oct 16, 2018
1 parent b12ae1b commit 58747c4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,17 @@ function layoutPanels() {
function initialize(entityType, entityLookupMethodName, entityLookupTitle, searchOptions) {
channel = new BroadcastChannel('cwrc-entity-management-forms')
channel.onmessage = (id) => {
const uri = entitySources[currentSearchOptions.entityType].get('cwrc').getEntityRoot()+'/'+id
returnResult({
id,
uri,
repository: 'cwrc'
})
entityFormWindow.close()
if (id === undefined) {
// add/edit failed so do nothing
} else {
const uri = entitySources[currentSearchOptions.entityType].get('cwrc').getEntityRoot()+'/'+id
returnResult({
id,
uri,
repository: 'cwrc'
})
entityFormWindow.close()
}
}

selectedResult = undefined
Expand Down

0 comments on commit 58747c4

Please sign in to comment.