mirror of https://github.com/zulip/zulip.git
user_status: Iterate over page_params.user_status with Object.entries.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
5564b39ea4
commit
dd10108c24
|
@ -144,6 +144,7 @@ page_params.never_subscribed = [];
|
|||
page_params.realm_notifications_stream_id = -1;
|
||||
page_params.unread_msgs = {};
|
||||
page_params.recent_private_conversations = [];
|
||||
page_params.user_status = {};
|
||||
|
||||
$('#tab_bar').append = () => {};
|
||||
$('#compose').filedrop = () => {};
|
||||
|
|
|
@ -59,7 +59,7 @@ exports.set_status_text = function (opts) {
|
|||
};
|
||||
|
||||
exports.initialize = function () {
|
||||
_.each(page_params.user_status, function (dct, str_user_id) {
|
||||
for (const [str_user_id, dct] of Object.entries(page_params.user_status)) {
|
||||
// JSON does not allow integer keys, so we
|
||||
// convert them here.
|
||||
const user_id = parseInt(str_user_id, 10);
|
||||
|
@ -71,7 +71,7 @@ exports.initialize = function () {
|
|||
if (dct.status_text) {
|
||||
user_info.set(user_id, dct.status_text);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
delete page_params.user_status;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue