From c50a1cfbbe860b384f33f22fcc2543554399206f Mon Sep 17 00:00:00 2001 From: Tim Hostetler Date: Mon, 12 Mar 2018 13:20:43 -0400 Subject: [PATCH] Reset On Render --- src/js/widgets/author_affiliation_tool/widget.jsx.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/widgets/author_affiliation_tool/widget.jsx.js b/src/js/widgets/author_affiliation_tool/widget.jsx.js index 2bb746361..fd1095631 100644 --- a/src/js/widgets/author_affiliation_tool/widget.jsx.js +++ b/src/js/widgets/author_affiliation_tool/widget.jsx.js @@ -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(); @@ -123,6 +126,9 @@ define([ * @returns {*} */ renderWidgetForListOfBibcodes: function (ids) { + + // reset on load + this.store.dispatch(actions.appReset()); return this.fetchAffiliationData(ids); }, @@ -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()); }, /**