From ad10c77919eee5e7f40740185c70a601e59805ed Mon Sep 17 00:00:00 2001 From: Lalit Date: Fri, 14 Jul 2023 17:02:40 +0530 Subject: [PATCH] settings_user: Pass data of correct type to `list_widget.render_item`. Since `list_widget.render_item` accepts the parameter of type `Item` and not `Key`, therefore we should pass the actual item instead of just plain id to the `render_item` function here. --- web/src/settings_users.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/settings_users.js b/web/src/settings_users.js index 3125417d04..b07735c170 100644 --- a/web/src/settings_users.js +++ b/web/src/settings_users.js @@ -287,7 +287,7 @@ section.bots.create_table = () => { name: "admin_bot_list", get_item: bot_info, modifier: render_admin_user_list, - html_selector: (item) => $(`tr[data-user-id='${CSS.escape(item)}']`), + html_selector: (item) => $(`tr[data-user-id='${CSS.escape(item.user_id)}']`), filter: { $element: $bots_table.closest(".settings-section").find(".search"), predicate(item, value) { @@ -380,7 +380,7 @@ export function update_bot_data(bot_user_id) { return; } - bot_list_widget.render_item(bot_user_id); + bot_list_widget.render_item(bot_info(bot_user_id)); } export function update_user_data(user_id, new_data) {