From fe3e58b497a45b0f32f8a57882b20bca537d22a9 Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Fri, 13 Jan 2023 17:47:45 +0530 Subject: [PATCH] settings_bots: Remove unused functions. This commit removes bot_error function in settings_bots.js since it is not used now. It was added in d90d1a04 and was used in error handling, but since we changed the design to show dialog for reactivation and deactivation of bots and errors are shown inside the dialog and errors are handled differently and thus the function's usage was removed in a9893fb6545. This commit also removes get_bot_info_div which was only used by bot_error function. --- static/js/settings_bots.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/static/js/settings_bots.js b/static/js/settings_bots.js index a6c678d449..453458343c 100644 --- a/static/js/settings_bots.js +++ b/static/js/settings_bots.js @@ -48,20 +48,6 @@ const focus_tab = { }, }; -export function get_bot_info_div(bot_id) { - const sel = `.bot_info[data-user-id="${CSS.escape(bot_id)}"]`; - return $(sel).expectOne(); -} - -export function bot_error(bot_id, xhr) { - const $bot_info = get_bot_info_div(bot_id); - const $bot_error_div = $bot_info.find(".bot_error"); - $bot_error_div.text(JSON.parse(xhr.responseText).msg); - $bot_error_div.show(); - const $bot_box = $bot_info.closest(".bot-information-box"); - $bot_box.scrollTop($bot_box[0].scrollHeight - $bot_box[0].clientHeight); -} - function add_bot_row(info) { const $row = $(render_bot_avatar_row(info)); if (info.is_active) {