diff --git a/static/js/toastHandler.js b/static/js/toastHandler.js index 5fbb8fb..60dc1f1 100644 --- a/static/js/toastHandler.js +++ b/static/js/toastHandler.js @@ -1,5 +1,5 @@ currentToasts = []; - +var forceSkipReload = false; /** * Generic function to create a new toast * @param {String} message The message to be displayed @@ -8,7 +8,7 @@ currentToasts = []; * @param {Boolean} autoReload Should the page reload after the toast is hidden, default is true (for compatibility with old code) * @returns {String} The id of the created toast, format: toast- */ -function createNewToast(message, colorSelector, autoHideTime = 3000, autoReload = true) { +function createNewToast(message, colorSelector, autoHideTime = 1500, autoReload = true) { const targetContainer = document.getElementById('toastMainController'); const masterToast = document.getElementById('masterToast'); const newToast = masterToast.cloneNode(true); @@ -21,7 +21,7 @@ function createNewToast(message, colorSelector, autoHideTime = 3000, autoReload $(newToast).toast('show'); setTimeout(() => { destroyToast(newToast.id); - if (autoReload) { + if (autoReload && !forceSkipReload) { location.reload(); } }, autoHideTime);