Add stream_data.get_recent_topics_for_id().

This commit is contained in:
Steve Howell 2017-05-14 08:38:07 -07:00 committed by Tim Abbott
parent 762194f98d
commit 2e39d48626
2 changed files with 7 additions and 1 deletions

View File

@ -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 [];

View File

@ -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();