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.

message_edit: Use decorated channel icon in message moved banner.

sandeep09ca5d3891ec
diff --git a/web/src/message_edit.ts b/web/src/message_edit.ts
index 47346248566..a87f36fcc50 100644
--- a/web/src/message_edit.ts
+++ b/web/src/message_edit.ts
@@ -1630,7 +1630,13 @@ type ToastParams = {
};
function show_message_moved_toast(toast_params: ToastParams): void {
- const new_stream_name = sub_store.maybe_get_stream_name(toast_params.new_stream_id);
+ const new_stream = sub_store.get(toast_params.new_stream_id);
+ if (new_stream === undefined) {
+ blueslip.error("Cannot find stream for message moved toast", {
+ stream_id: toast_params.new_stream_id,
+ });
+ return;
+ }
const new_topic_display_name = util.get_final_topic_display_name(toast_params.new_topic_name);
const is_empty_string_topic = toast_params.new_topic_name === "";
const new_location_url = hash_util.by_stream_topic_url(
@@ -1640,7 +1646,7 @@ function show_message_moved_toast(toast_params: ToastParams): void {
feedback_widget.show({
populate($container) {
const widget_body_html = render_message_moved_widget_body({
- new_stream_name,
+ stream: new_stream,
new_topic_display_name,
new_location_url,
is_empty_string_topic,
diff --git a/web/templates/message_moved_widget_body.hbs b/web/templates/message_moved_widget_body.hbs
index 29e42424662..c5844f7e165 100644
--- a/web/templates/message_moved_widget_body.hbs
+++ b/web/templates/message_moved_widget_body.hbs
@@ -4,7 +4,7 @@
{{#*inline "z-link"~}}
<a class="white-space-preserve-wrap" href="{{new_location_url}}">
{{~!-- squash whitespace --~}}
- #{{new_stream_name}} &gt; <span {{#if is_empty_string_topic}}class="empty-topic-display"{{/if}}>{{new_topic_display_name}}</span>
+ {{> decorated_channel_name stream=stream inline_with_text=true show_colored_icon=false}} &gt; <span {{#if is_empty_string_topic}}class="empty-topic-display"{{/if}}>{{new_topic_display_name}}</span>
{{~!-- squash whitespace --~}}
</a>
{{~/inline}}