Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
fix: only update store when new dataset comes in
Browse files Browse the repository at this point in the history
  • Loading branch information
vhf committed Oct 28, 2019
1 parent 4e9e76f commit bec8266
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions store/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ export const actions = {
commit('clientReady')
return Promise.resolve('deserialized')
},
async [RELOAD_DATASET] ({ commit, dispatch, rootState }) {
async [RELOAD_DATASET] ({ commit, dispatch, state, rootState }) {
const { ontologyDataset, structureDataset } = await fetchDataset(rootState.config)
commit('ontologyInit', ontologyDataset)
commit('structureInit', structureDataset)
if (state.ontologySerialized !== serialize(ontologyDataset) || state.structureSerialized !== serialize(structureDataset)) {
commit('ontologyInit', ontologyDataset)
commit('structureInit', structureDataset)
}
return dispatch(DESERIALIZE)
}
}
Expand Down

0 comments on commit bec8266

Please sign in to comment.