mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 23:19:10 +00:00
Only re-render the streams list when the sort order has changed
(imported from commit 8122785097e2470e9e85f1f4c40bf1cd63264fa4)
This commit is contained in:
@@ -2,6 +2,7 @@ var stream_list = (function () {
|
||||
|
||||
var exports = {};
|
||||
|
||||
var previous_sort_order;
|
||||
exports.sort_narrow_list = function () {
|
||||
var streams = subs.subscribed_streams();
|
||||
if (streams.length === 0) {
|
||||
@@ -23,6 +24,13 @@ exports.sort_narrow_list = function () {
|
||||
return util.strcmp(a, b);
|
||||
});
|
||||
|
||||
if (previous_sort_order !== undefined
|
||||
&& util.array_compare(previous_sort_order, streams)) {
|
||||
return;
|
||||
}
|
||||
|
||||
previous_sort_order = streams;
|
||||
|
||||
var parent = $('#stream_filters');
|
||||
parent.empty();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user