From 6fcc96f5aa9af28aaddf6eb063d34dc91bb38e55 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 5 Jan 2021 13:23:47 -0800 Subject: [PATCH] Don't clear the easybake field until response comes back. --- frontends/etiquette_flask/templates/tags.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontends/etiquette_flask/templates/tags.html b/frontends/etiquette_flask/templates/tags.html index 7f1c168..cb53d12 100644 --- a/frontends/etiquette_flask/templates/tags.html +++ b/frontends/etiquette_flask/templates/tags.html @@ -271,8 +271,18 @@ function easybake_form() add_tag_textbox.focus(); return; } - api.tags.easybake(easybake_string, tag_action_callback); - add_tag_textbox.value = ""; + + function callback(response) + { + if (response.meta.status !== 200) + { + alert(JSON.stringify(response)); + return; + } + tag_action_callback(response); + add_tag_textbox.value = ""; + } + api.tags.easybake(easybake_string, callback); } function delete_specific_tag_form(event)