Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

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

Vector73fa7a4a953da7
diff --git a/web/src/compose_validate.ts b/web/src/compose_validate.ts
index 457357b7495..9ab8227ca29 100644
--- a/web/src/compose_validate.ts
+++ b/web/src/compose_validate.ts
@@ -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;