recent_topics: Use get_sub_by_id in format_topic to get stream info.

We can use get_sub_by_id instead of get_sub to get the stream info,
as we already have stream id from the message object. We are using
stream ids so that we can avoid bugs related to live update after
stream rename.
This commit is contained in:
sahil839
2020-06-20 01:50:30 +05:30
committed by Tim Abbott
parent f3604fbb1e
commit 30c55a1ea7
2 changed files with 2 additions and 2 deletions

View File

@@ -158,7 +158,7 @@ function format_topic(topic_data) {
const last_msg = message_store.get(topic_data.last_msg_id);
const stream = last_msg.stream;
const stream_id = last_msg.stream_id;
const stream_info = stream_data.get_sub(stream);
const stream_info = stream_data.get_sub_by_id(stream_id);
const topic = last_msg.topic;
const time = new XDate(last_msg.timestamp * 1000);
const last_msg_time = timerender.last_seen_status_from_date(time);