From 84ff2241ba81fc6a1a2201074d30f971dad8a0de Mon Sep 17 00:00:00 2001 From: Pitu Date: Wed, 18 Jan 2017 02:40:14 -0300 Subject: Shit ton of things on this update --- public/js/upload.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'public/js/upload.js') diff --git a/public/js/upload.js b/public/js/upload.js index 3672077..0341ecc 100644 --- a/public/js/upload.js +++ b/public/js/upload.js @@ -37,11 +37,18 @@ upload.verifyToken = function(token, reloadOnError = false){ var json = JSON.parse(xhr.responseText); if(json.success === false){ - alert(json.description); - if(reloadOnError){ - localStorage.removeItem("token"); - location.reload(); - } + + swal({ + title: "An error ocurred", + text: json.description, + type: "error" + }, function(){ + if(reloadOnError){ + localStorage.removeItem("token"); + location.reload(); + } + }) + return; } -- cgit v1.2.3