bots settings: Stop modal from getting closed when an error is shown.

This commit fixes the issue of error message not getting
displayed when the `Full name` field, in bots settings, is given
a duplicate name of an already created bot with the same name.

We were closing the modal each time whether the request is
successful or not. Hence, we now close the modal only
when the request is successful and error is displayed on
the modal otherwise.

Fixes #18091.
This commit is contained in:
akshatdalton
2021-04-12 18:58:02 +00:00
committed by Tim Abbott
parent 146b32d63a
commit b9a318485c
2 changed files with 4 additions and 1 deletions

View File

@@ -542,7 +542,6 @@ export function set_up() {
loading.destroy_indicator(spinner);
edit_button.show();
errors.text(JSON.parse(xhr.responseText).msg).show();
overlays.close_modal("#edit_bot_modal");
},
});
},

View File

@@ -825,6 +825,10 @@ input[type="checkbox"] {
font-weight: 400;
}
.bot_edit_errors {
margin: 20px 20px 0 20px;
}
#bots_lists_navbar .active a {
background-color: hsl(0, 0%, 98%);
}