mirror of
https://github.com/zulip/zulip.git
synced 2025-10-25 00:53:56 +00:00
message_list_view: Fix handling of links to deleted streams.
Previously, links to deleted streams would be incorrectly rendered as stream's name). Fixes an issue that was reported where after deleting the "general" stream, the welcome turtle messages might appear as links to
This commit is contained in:
@@ -590,7 +590,13 @@ MessageListView.prototype = {
|
||||
if (stream_id && !$(this).find(".highlight").length) {
|
||||
// Display the current name for stream if it is not
|
||||
// being displayed in search highlight.
|
||||
$(this).text("#" + stream_data.maybe_get_stream_name(stream_id));
|
||||
const stream_name = stream_data.maybe_get_stream_name(stream_id);
|
||||
if (stream_name !== undefined) {
|
||||
// If the stream has been deleted,
|
||||
// stream_data.maybe_get_stream_name might return
|
||||
// undefined. Otherwise, display the current stream name.
|
||||
$(this).text("#" + stream_name);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -601,7 +607,13 @@ MessageListView.prototype = {
|
||||
// being displayed in search highlight.
|
||||
const text = $(this).text();
|
||||
const topic = text.split('>', 2)[1];
|
||||
$(this).text("#" + stream_data.maybe_get_stream_name(stream_id) + ' > ' + topic);
|
||||
const stream_name = stream_data.maybe_get_stream_name(stream_id);
|
||||
if (stream_name !== undefined) {
|
||||
// If the stream has been deleted,
|
||||
// stream_data.maybe_get_stream_name might return
|
||||
// undefined. Otherwise, display the current stream name.
|
||||
$(this).text("#" + stream_name + ' > ' + topic);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user