Skip to content

Commit

Permalink
Reset On Render
Browse files Browse the repository at this point in the history
  • Loading branch information
thostetler committed Mar 12, 2018
1 parent 163451d commit c50a1cf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/widgets/author_affiliation_tool/widget.jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ define([
renderWidgetForCurrentQuery: function ({ currentQuery }) {
const pubsub = this.getPubSub();

// reset on load
this.store.dispatch(actions.appReset());

// do nothing if we don't get a query
if (currentQuery) {
const q = currentQuery.clone();
Expand Down Expand Up @@ -123,6 +126,9 @@ define([
* @returns {*}
*/
renderWidgetForListOfBibcodes: function (ids) {

// reset on load
this.store.dispatch(actions.appReset());
return this.fetchAffiliationData(ids);
},

Expand Down Expand Up @@ -220,10 +226,8 @@ define([
* Close the widget
*/
closeWidget: function () {
const { dispatch } = this.store;
const pubsub = this.getPubSub();
pubsub.publish(pubsub.NAVIGATE, "results-page");
dispatch(actions.appReset());
},

/**
Expand Down

0 comments on commit c50a1cf

Please sign in to comment.