From cdd8f9e24830000516a3e1b881aecc1af8f03ce8 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 19 Jan 2018 21:44:21 -0800 Subject: [PATCH] Only reload the page if the clip operation was successful. --- frontends/etiquette_flask/templates/album.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frontends/etiquette_flask/templates/album.html b/frontends/etiquette_flask/templates/album.html index f8391ab..76de3fb 100644 --- a/frontends/etiquette_flask/templates/album.html +++ b/frontends/etiquette_flask/templates/album.html @@ -131,10 +131,13 @@ function _paste_unpaste_photo_clipboard(add_or_remove) var url = "/album/{{album.id}}/" + add_or_remove; var data = new FormData(); data.append("photo_id", photo_ids); - var callback = function(){ - photo_clipboard.clear(); - save_photo_clipboard(); - location.reload(); + var callback = function(response){ + if (response["_status"] === 200) + { + photo_clipboard.clear(); + save_photo_clipboard(); + location.reload(); + } }; post(url, data, callback); }