user_status: Iterate over page_params.user_status with Object.entries.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-02-06 03:31:32 +00:00
committed by Tim Abbott
parent 5564b39ea4
commit dd10108c24
2 changed files with 3 additions and 2 deletions

View File

@@ -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;
};