add saved bot to opponent list

This commit is contained in:
Ilion Beyst 2022-04-25 19:59:43 +02:00
parent 41f1679ef4
commit 9f24a6184e

View file

@ -72,6 +72,11 @@
if (response.ok) { if (response.ok) {
dispatch("botSaved", responseData); dispatch("botSaved", responseData);
saveBotName(botName); saveBotName(botName);
// make bot available in available bot list
if (!availableBots.find((bot) => bot["id"] == responseData["id"])) {
availableBots = [...availableBots, responseData];
}
// clear errors // clear errors
saveErrors = []; saveErrors = [];
} else { } else {