Streamline typeahead for stream links.

We don't need to get sorted streams in the "source"
function for typeahead, since we sort them later,
and we don't need to recalculate values.

This preserves the behavior that we include
unsubscribed streams in the typeahead, which is
probably intentional.
This commit is contained in:
Steve Howell 2018-07-30 13:27:18 +00:00 committed by Tim Abbott
parent 132d0971ae
commit 51edcb02c8
2 changed files with 5 additions and 1 deletions

View File

@ -411,7 +411,7 @@ exports.compose_content_begins_typeahead = function (query) {
this.completing = 'stream';
this.token = current_token;
return stream_data.get_streams_for_settings_page();
return stream_data.get_unsorted_subs();
}
return false;
};

View File

@ -147,6 +147,10 @@ exports.get_non_default_stream_names = function () {
return names;
};
exports.get_unsorted_subs = function () {
return stream_info.values();
};
exports.subscribed_subs = function () {
return _.where(stream_info.values(), {subscribed: true});
};