typing_events: Show typing notification in a proper topic narrow.

It is possible to have multiple topic / stream terms if user
is searching or if the URL is malformed. So, we should check
if the user is in a proper topic narrow before showing
typing notifications.

This fixes the error of topic being undefined due to there
being multiple topic terms in narrow when trying to display
notifications.
This commit is contained in:
Aman Agrawal 2024-01-08 04:41:52 +00:00 committed by Tim Abbott
parent 3bf047beb8
commit c58c12911c
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ const MAX_USERS_TO_DISPLAY_NAME = 3;
// that make typing indicators work.
function get_users_typing_for_narrow() {
if (narrow_state.narrowed_to_topic()) {
if (narrow_state.narrowed_by_topic_reply()) {
return typing_data.get_topic_typists(narrow_state.stream_id(), narrow_state.topic());
}