Only reload the page if the clip operation was successful.

This commit is contained in:
voussoir 2018-01-19 21:44:21 -08:00
parent b00d93901a
commit cdd8f9e248

View file

@ -131,10 +131,13 @@ function _paste_unpaste_photo_clipboard(add_or_remove)
var url = "/album/{{album.id}}/" + add_or_remove; var url = "/album/{{album.id}}/" + add_or_remove;
var data = new FormData(); var data = new FormData();
data.append("photo_id", photo_ids); data.append("photo_id", photo_ids);
var callback = function(){ var callback = function(response){
photo_clipboard.clear(); if (response["_status"] === 200)
save_photo_clipboard(); {
location.reload(); photo_clipboard.clear();
save_photo_clipboard();
location.reload();
}
}; };
post(url, data, callback); post(url, data, callback);
} }