compose: Ensure we don't warn unresolved topic if not composing for a topic.

In future commits, it will become possible to have a non-null
`compose_state.topic()` while in private message view, because
we'll be keeping that state for switching between the stream
and private message views. See #21853 for further context.
We don't want to warn about a resolved topic unless the topic
is actively visible in the compose box.
This commit is contained in:
evykassirer
2022-08-03 23:30:55 -07:00
committed by Tim Abbott
parent ef044b8697
commit 99d1c5a1f3
2 changed files with 7 additions and 0 deletions

View File

@@ -170,6 +170,9 @@ export function clear_topic_resolved_warning() {
}
export function warn_if_topic_resolved(topic_changed) {
if (compose_state.recipient_has_topics()) {
return;
}
// This function is called with topic_changed=false on every
// keypress when typing a message, so it should not do anything
// expensive in that case.