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.
This commit is contained in:
voussoir 2020-09-10 06:48:56 -07:00
parent 2d01297729
commit 4b76bc0628

View file

@ -310,7 +310,6 @@ function add_remove_photo_tag_callback(response)
{ {
let message_text; let message_text;
let message_positivity; let message_positivity;
let tagname = response.data.tagname;
if ("error_type" in response.data) if ("error_type" in response.data)
{ {
message_positivity = "message_negative"; message_positivity = "message_negative";
@ -318,6 +317,7 @@ function add_remove_photo_tag_callback(response)
} }
else else
{ {
const tagname = response.data.tagname;
let action; let action;
message_positivity = "message_positive"; message_positivity = "message_positive";
if (response.meta.request_url.includes("add_tag")) if (response.meta.request_url.includes("add_tag"))