From 4b76bc062885485ae9d869bf4a914d2ab36594e6 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 10 Sep 2020 06:48:56 -0700 Subject: [PATCH] Don't access response.data.tagname until we know it's not an error. This wasn't causing any issues, because it was just setting itself to undefined, but I realized I should move it. --- frontends/etiquette_flask/templates/photo.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/etiquette_flask/templates/photo.html b/frontends/etiquette_flask/templates/photo.html index 8330fd7..b23bfbe 100644 --- a/frontends/etiquette_flask/templates/photo.html +++ b/frontends/etiquette_flask/templates/photo.html @@ -310,7 +310,6 @@ function add_remove_photo_tag_callback(response) { let message_text; let message_positivity; - let tagname = response.data.tagname; if ("error_type" in response.data) { message_positivity = "message_negative"; @@ -318,6 +317,7 @@ function add_remove_photo_tag_callback(response) } else { + const tagname = response.data.tagname; let action; message_positivity = "message_positive"; if (response.meta.request_url.includes("add_tag"))