mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
streams: Store list of stream ids instead of names for sorting.
We will store list of stream ids to sort streams instead of names. We have added a compare_function for sorting the list of stream_ids by comparing stream names. This change helps us to remove a couple of get_sub calls and using stream ids instead of name also helps in avoiding bugs caused due to live update on renaming of stream.
This commit is contained in:
@@ -87,7 +87,7 @@ exports.build_stream_list = function () {
|
||||
// sidebar rows. Our job here is to build the bigger widget,
|
||||
// which largely is a matter of arranging the individual rows in
|
||||
// the right order.
|
||||
const streams = stream_data.subscribed_streams();
|
||||
const streams = stream_data.subscribed_stream_ids();
|
||||
if (streams.length === 0) {
|
||||
return;
|
||||
}
|
||||
@@ -103,9 +103,8 @@ exports.build_stream_list = function () {
|
||||
const parent = $("#stream_filters");
|
||||
const elems = [];
|
||||
|
||||
function add_sidebar_li(stream) {
|
||||
const sub = stream_data.get_sub(stream);
|
||||
const sidebar_row = exports.stream_sidebar.get_row(sub.stream_id);
|
||||
function add_sidebar_li(stream_id) {
|
||||
const sidebar_row = exports.stream_sidebar.get_row(stream_id);
|
||||
sidebar_row.update_whether_active();
|
||||
elems.push(sidebar_row.get_li());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user