From 96e7c85177f12267ad376f1710109e581d76d160 Mon Sep 17 00:00:00 2001 From: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com> Date: Tue, 3 May 2022 11:16:20 -0500 Subject: [PATCH] FIX: updated filtered replies when replies exist (#16610) --- app/assets/javascripts/discourse/app/widgets/post.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/widgets/post.js b/app/assets/javascripts/discourse/app/widgets/post.js index a6f58ae04e7..e4354c844a7 100644 --- a/app/assets/javascripts/discourse/app/widgets/post.js +++ b/app/assets/javascripts/discourse/app/widgets/post.js @@ -436,8 +436,11 @@ createWidget("post-contents", { if (this.siteSettings.enable_filtered_replies_view) { const topicController = this.register.lookup("controller:topic"); - defaultState.filteredRepliesShown = - topicController.replies_to_post_number === attrs.post_number.toString(); + if (attrs.post_number) { + defaultState.filteredRepliesShown = + topicController.replies_to_post_number === + attrs.post_number.toString(); + } } return defaultState;