Skip to content

Commit

Permalink
Fixes bug that displayed modal when state did not change
Browse files Browse the repository at this point in the history
  • Loading branch information
jermnelson committed May 6, 2020
1 parent 1e957f9 commit 6345284
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/actionCreators/resources.test.js
Expand Up @@ -283,7 +283,7 @@ describe('publishResource', () => {
await store.dispatch(publishResource('jkl012', currentUser, group, 'testerrorkey'))
expect(store.getActions()).toEqual([
{ type: 'SET_BASE_URL', payload: { resourceKey: 'jkl012', resourceURI: 'http://sinopia.io/repository/myGroup/myResource' } },
{ type: 'SAVE_RESOURCE_FINISHED', payload: { resourceKey: 'jkl012', checksum: 'e37c563187b12275acf955128f14f3f3' } },
{ type: 'SAVE_RESOURCE_FINISHED', payload: { resourceKey: 'jkl012', checksum: '5e30bd59d0186c5307065436240ba108' } },
])
})

Expand Down
2 changes: 1 addition & 1 deletion src/actionCreators/resources.js
Expand Up @@ -89,7 +89,7 @@ const chooseURI = (dataset, uri) => (dataset.match(rdf.namedNode(uri)).size > 0
export const publishResource = (resourceKey, currentUser, group, errorKey) => (dispatch, getState) => {
// Make a copy of state to prevent changes that will affect the publish.
const state = _.cloneDeep(getState())
const rdf = new GraphBuilder(state.selectorReducer.entities.resources[resourceKey], state.selectorReducer.entities.resourceTemplates).toTurtle()
const rdf = new GraphBuilder(state.selectorReducer.entities.resources[resourceKey], state.selectorReducer.entities.resourceTemplates).graph.toCanonical()

return publishRDFResource(currentUser, rdf, group).then((result) => {
const resourceUrl = result.response.headers.location
Expand Down

0 comments on commit 6345284

Please sign in to comment.