FIX: Don't cancel filtering on second "n replies" tap (#11975)

Fixes an issue introduced in 0f31a221c9.
This commit is contained in:
Penar Musaraj 2021-02-04 11:41:01 -05:00 committed by GitHub
parent eb29827e9d
commit 85310f82f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions

View File

@ -440,13 +440,17 @@ createWidget("post-contents", {
},
toggleFilteredRepliesView() {
const post = this.findAncestorModel();
const controller = this.register.lookup("controller:topic");
if (post.get("topic.postStream.filterRepliesToPostNumber")) {
controller.send(
"cancelFilter",
post.get("topic.postStream.filterRepliesToPostNumber")
const post = this.findAncestorModel(),
controller = this.register.lookup("controller:topic"),
currentFilterPostNumber = post.get(
"topic.postStream.filterRepliesToPostNumber"
);
if (
currentFilterPostNumber &&
currentFilterPostNumber === post.post_number
) {
controller.send("cancelFilter", currentFilterPostNumber);
this.state.filteredRepliesShown = false;
} else {
this.state.filteredRepliesShown = true;