From 1d3d9d2935814ba3ef53b175e9d4b5f91898f91c Mon Sep 17 00:00:00 2001 From: kek7198 Date: Mon, 3 Jan 2022 14:55:21 -0600 Subject: [PATCH] fix --- files/assets/CHRISTMAS/js/default.js | 3 +-- files/templates/CHRISTMAS/default.html | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/files/assets/CHRISTMAS/js/default.js b/files/assets/CHRISTMAS/js/default.js index c60bc862c..f626ddc2f 100644 --- a/files/assets/CHRISTMAS/js/default.js +++ b/files/assets/CHRISTMAS/js/default.js @@ -245,8 +245,8 @@ function submitFormAjax(e, success, error) { xhr.open("POST", actionPath, true); xhr.onload = function() { - data = JSON.parse(xhr.response); if (xhr.status >= 200 && xhr.status < 300 && !data["error"]) { + data = JSON.parse(xhr.response); try { document.getElementById('toast-post-success-text').innerText = data["message"]; } catch(e) { @@ -262,7 +262,6 @@ function submitFormAjax(e, success, error) { } else { try { data=JSON.parse(xhr.response); - var myToast = new bootstrap.Toast(document.getElementById('toast-post-error')); myToast.show(); document.getElementById('toast-post-error-text').innerText = data["error"]; diff --git a/files/templates/CHRISTMAS/default.html b/files/templates/CHRISTMAS/default.html index 63ee7d5ba..c94570512 100644 --- a/files/templates/CHRISTMAS/default.html +++ b/files/templates/CHRISTMAS/default.html @@ -357,7 +357,7 @@ } {% endif %} - +