From 2e39d486265a4f9b97c594cbd2ac396512f5d672 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sun, 14 May 2017 08:38:07 -0700 Subject: [PATCH] Add stream_data.get_recent_topics_for_id(). --- static/js/stream_data.js | 6 ++++++ static/js/topic_list.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/static/js/stream_data.js b/static/js/stream_data.js index 32a5b2c6f3..80af023729 100644 --- a/static/js/stream_data.js +++ b/static/js/stream_data.js @@ -451,7 +451,13 @@ exports.initialize_from_page_params = function () { delete page_params.never_subscribed; }; +exports.get_recent_topics_for_id = function (stream_id) { + return recent_topics.get(stream_id); +}; + exports.get_recent_topics = function (stream_name) { + // TODO: deprecate this and have callers use + // get_recent_topics_for_id var stream_id = exports.get_stream_id(stream_name); if (!stream_id) { return []; diff --git a/static/js/topic_list.js b/static/js/topic_list.js index 368b5fb9b3..3d5ed443ed 100644 --- a/static/js/topic_list.js +++ b/static/js/topic_list.js @@ -58,7 +58,7 @@ exports.build_widget = function (parent_elem, stream, active_topic, max_topics) function build_list(stream, active_topic, max_topics) { - var topics = stream_data.get_recent_topics(stream) || []; + var topics = stream_data.get_recent_topics_for_id(my_stream_id) || []; if (active_topic) { active_topic = active_topic.toLowerCase();