mirror of https://github.com/zulip/zulip.git
settings_users: Remove unnecessary bot user undefined check.
Users are fetched from `people_by_user_id_dict`. `bot_info` is only called from: * `bots_create_table`, with ids from `get_bot_ids` which are from this `people_by_user_id_dict`. * `update_bot_data`, which is called in two places that check `is_valid_bot_user` on the bot id first. So we should always get a `bot_user` back, and we're already relying on the bot users being defined in several methods of the `bot_list_widget`.
This commit is contained in:
parent
0e3374dc1b
commit
6aa08b9c50
|
@ -220,12 +220,7 @@ function bot_owner_full_name(owner_id) {
|
|||
}
|
||||
|
||||
function bot_info(bot_user_id) {
|
||||
const bot_user = people.maybe_get_user_by_id(bot_user_id);
|
||||
|
||||
if (!bot_user) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const bot_user = people.get_by_user_id(bot_user_id);
|
||||
const owner_id = bot_user.bot_owner_id;
|
||||
|
||||
const info = {};
|
||||
|
@ -322,9 +317,6 @@ function bots_create_table() {
|
|||
filter: {
|
||||
$element: $bots_table.closest(".settings-section").find(".search"),
|
||||
predicate(item, value) {
|
||||
if (!item) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
item.full_name.toLowerCase().includes(value) ||
|
||||
item.display_email.toLowerCase().includes(value)
|
||||
|
|
Loading…
Reference in New Issue