compose_validate: Don't show topic moved banner on topic resolve.

The topic moved compose warning banner should not shown when
the topic in compose recipient box is only resolved or unresolved.

Fixes #35082.
This commit is contained in:
Vector73
2025-07-16 17:19:20 +00:00
committed by Tim Abbott
parent 640286b91f
commit fa7a4a953d

View File

@@ -521,7 +521,13 @@ export function inform_if_topic_is_moved(orig_topic: string, old_stream_id: numb
const message_content = compose_state.message_content();
const sub = stream_data.get_sub_by_id(stream_id);
const topic_name = compose_state.topic();
if (sub && message_content !== "") {
const stream_edited = stream_id !== old_stream_id;
const topic_edited = topic_name !== orig_topic;
const topic_is_renamed =
topic_edited &&
resolved_topic.unresolve_name(orig_topic) !== resolved_topic.unresolve_name(topic_name);
if (sub && message_content !== "" && (stream_edited || topic_is_renamed)) {
const old_stream = stream_data.get_sub_by_id(old_stream_id);
if (!old_stream) {
return;