diff --git a/framework/core/js/forum/src/components/IndexPage.js b/framework/core/js/forum/src/components/IndexPage.js index 00fa4b9d8..1d29f9d32 100644 --- a/framework/core/js/forum/src/components/IndexPage.js +++ b/framework/core/js/forum/src/components/IndexPage.js @@ -27,23 +27,18 @@ export default class IndexPage extends Component { this.lastDiscussion = app.current.discussion; } - const params = this.params(); - - if (app.cache.discussionList) { - // Compare the requested parameters (sort, search query) to the ones that - // are currently present in the cached discussion list. If they differ, we - // will clear the cache and set up a new discussion list component with - // the new parameters. - Object.keys(params).some(key => { - if (app.cache.discussionList.props.params[key] !== params[key]) { - app.cache.discussionList = null; - return true; - } - }); + // If the user is coming from the discussion list, then they have either + // just switched one of the parameters (filter, sort, search) or they + // probably want to refresh the results. We will clear the discussion list + // cache so that results are reloaded. + if (app.current instanceof IndexPage) { + app.cache.discussionList = null; } if (!app.cache.discussionList) { - app.cache.discussionList = new DiscussionList({params}); + app.cache.discussionList = new DiscussionList({ + params: this.params() + }); } app.history.push('index'); diff --git a/framework/core/js/forum/src/initializers/boot.js b/framework/core/js/forum/src/initializers/boot.js index 9d83a112f..b8a3d33e3 100644 --- a/framework/core/js/forum/src/initializers/boot.js +++ b/framework/core/js/forum/src/initializers/boot.js @@ -47,7 +47,6 @@ export default function boot(app) { if (e.ctrlKey || e.metaKey || e.which === 2) return; e.preventDefault(); app.history.home(); - app.drawer.hide(); }); // Add a class to the body which indicates that the page has been scrolled