better error message

pull/217/head
Aevann 2023-11-10 16:15:37 +02:00
parent 6472a517cc
commit 1b7c1e51c6
7 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,7 @@
const SITE_FULL_IMAGES = document.getElementById('SITE_FULL_IMAGES').value
function getMessageFromJsonData(success, json) {
let message = success ? "Success!" : "Error, please try again later";
let message = success ? "Success!" : "Error, please refresh the page and try again";
let key = success ? "message" : "error";
if (!json || !json[key]) return message;
message = json[key];
@ -17,7 +17,7 @@ function showToast(success, message) {
let element = success ? "toast-post-success" : "toast-post-error";
let textElement = element + "-text";
if (!message) {
message = success ? "Action successful!" : "Error, please try again later";
message = success ? "Action successful!" : "Error, please refresh the page and try again";
}
document.getElementById(textElement).textContent = message;
bootstrap.Toast.getOrCreateInstance(document.getElementById(element)).show();

View File

@ -87,7 +87,7 @@ function handleLotteryResponse(xhr, method, callback) {
const toastMessage = document.getElementById("lottery-post-error-text");
toastMessage.textContent =
(response && response.details) || "Error, please try again later.";
(response && response.details) || "Error, please refresh the page and try again.";
bootstrap.Toast.getOrCreateInstance(toast).show();
}

View File

@ -192,7 +192,7 @@
</div>
<div class="toast" id="toast-post-error" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 10000000000" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-danger text-center text-white">
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please try again later.</span>
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please refresh the page and try again.</span>
</div>
</div>
<script defer="" src="/assets/js/vendor/lozad.js?x=f404b566"></script>

View File

@ -194,7 +194,7 @@
</div>
<div class="toast" id="toast-post-error" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 10000000000" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-danger text-center text-white">
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please try again later.</span>
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please refresh the page and try again.</span>
</div>
</div>
<script defer="" src="/assets/js/vendor/lozad.js?x=f404b566"></script>

View File

@ -193,7 +193,7 @@
</div>
<div class="toast" id="toast-post-error" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 10000000000" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-danger text-center text-white">
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please try again later.</span>
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please refresh the page and try again.</span>
</div>
</div>
<script defer="" src="/assets/js/vendor/lozad.js?x=f404b566"></script>

View File

@ -195,7 +195,7 @@
</div>
<div class="toast" id="toast-post-error" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 10000000000" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-danger text-center text-white">
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please try again later.</span>
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please refresh the page and try again.</span>
</div>
</div>
<script defer="" src="/assets/js/vendor/lozad.js?x=f404b566"></script>

View File

@ -76,7 +76,7 @@
</div>
<div class="toast" id="toast-post-error" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 10000000000" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-danger text-center text-white">
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please try again later.</span>
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please refresh the page and try again.</span>
</div>
</div>
</body>