Skip to content

Commit

Permalink
Merge pull request #293 from ComPlat/fix-element-refresh-on-collectio…
Browse files Browse the repository at this point in the history
…n-change

Fix element refresh on change collection
  • Loading branch information
PiTrem committed Nov 15, 2016
2 parents 0406924 + f57ad47 commit f31a302
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions app/assets/javascripts/components/stores/ElementStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ class ElementStore {
// -- Samples --

handleFetchSampleById(result) {
this.state.currentElement = result;
if (!this.state.currentElement || this.state.currentElement._checksum != result._checksum) {
this.state.currentElement = result;
}
}

handleFetchSamplesByCollectionId(result) {
Expand Down Expand Up @@ -369,7 +371,9 @@ class ElementStore {
// -- Screens --

handleFetchScreenById(result) {
this.state.currentElement = result;
if (!this.state.currentElement || this.state.currentElement._checksum != result._checksum) {
this.state.currentElement = result;
}
}

handleFetchScreensByCollectionId(result) {
Expand Down Expand Up @@ -397,9 +401,11 @@ class ElementStore {
// -- Reactions --

handleFetchReactionById(result) {
this.state.currentElement = result;
this.state.elements.reactions.elements = this.refreshReactionsListForSpecificReaction(result);
this.navigateToNewElement(result);
if (!this.state.currentElement || this.state.currentElement._checksum != result._checksum) {
this.state.currentElement = result;
this.state.elements.reactions.elements = this.refreshReactionsListForSpecificReaction(result);
this.navigateToNewElement(result);
}
}

refreshReactionsListForSpecificReaction(newReaction) {
Expand Down

0 comments on commit f31a302

Please sign in to comment.