Skip to content

Commit

Permalink
DEV: Clear filters when navigating to a post (#12557)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmusaraj committed Mar 30, 2021
1 parent 65ad875 commit 524890c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ const DiscourseURL = EmberObject.extend({
opts.nearPost = topicController.get("model.highest_post_number");
}

opts.cancelSummary = true;
opts.cancelFilter = true;

postStream.refresh(opts).then(() => {
const closest = postStream.closestPostNumberFor(opts.nearPost || 1);
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/discourse/app/models/post-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ export default RestModel.extend({
opts = opts || {};
opts.nearPost = parseInt(opts.nearPost, 10);

if (opts.cancelSummary) {
this.set("summary", false);
delete opts.cancelSummary;
if (opts.cancelFilter) {
this.cancelFilter();
delete opts.cancelFilter;
}

const topic = this.topic;
Expand Down

1 comment on commit 524890c

@discoursebot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/links-to-hidden-messages-dont-clear-filters/184491/8

Please sign in to comment.