diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-04-25 19:59:43 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-04-25 19:59:43 +0200 |
commit | 9f24a6184e6b63346aea33373b10a92e86b31225 (patch) | |
tree | 7ba75b06e3bc954d9b649b11d4af70d9887b5065 /web/pw-server/src | |
parent | 41f1679ef46238aff86e1811f73007b88eb4d53b (diff) | |
download | planetwars.dev-9f24a6184e6b63346aea33373b10a92e86b31225.tar.xz planetwars.dev-9f24a6184e6b63346aea33373b10a92e86b31225.zip |
add saved bot to opponent list
Diffstat (limited to 'web/pw-server/src')
-rw-r--r-- | web/pw-server/src/lib/components/SubmitPane.svelte | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/web/pw-server/src/lib/components/SubmitPane.svelte b/web/pw-server/src/lib/components/SubmitPane.svelte index 20a6a39..740f2cf 100644 --- a/web/pw-server/src/lib/components/SubmitPane.svelte +++ b/web/pw-server/src/lib/components/SubmitPane.svelte @@ -72,6 +72,11 @@ if (response.ok) { dispatch("botSaved", responseData); saveBotName(botName); + + // make bot available in available bot list + if (!availableBots.find((bot) => bot["id"] == responseData["id"])) { + availableBots = [...availableBots, responseData]; + } // clear errors saveErrors = []; } else { |