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