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
a9893fb654.

This commit also removes get_bot_info_div which was only
used by bot_error function.
This commit is contained in:
Sahil Batra
2023-01-13 17:47:45 +05:30
committed by Tim Abbott
parent 2aeda1b0c4
commit fe3e58b497

View File

@@ -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) { function add_bot_row(info) {
const $row = $(render_bot_avatar_row(info)); const $row = $(render_bot_avatar_row(info));
if (info.is_active) { if (info.is_active) {