| @@ -59,12 +59,9 @@ | ||
| 59 | 59 | window.location.href = response.data.redirect_url; |
| 60 | 60 | return; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - // A toast that stands in for a hidden success message stays until | |
| 64 | - // the visitor closes it — otherwise the form is left saying | |
| 65 | - // nothing at all after ten seconds. | |
| 66 | - showNotification( response.data.error.message, 'error', !! response.data.error.hide_confirmation ); | |
| 63 | + showNotification( response.data.error.message, 'error' ); | |
| 67 | 64 | |
| 68 | 65 | // Prevent duplicate checks for 5 seconds |
| 69 | 66 | cooldown = true; |
| 70 | 67 | setTimeout( function () { |
| @@ -128,12 +125,11 @@ | ||
| 128 | 125 | /** |
| 129 | 126 | * Show a toast notification. |
| 130 | 127 | * |
| 131 | 128 | * @param {string} message The message to display. |
| 132 | - * @param {string} [type] 'error' (default) or 'success' — controls colour + icon. | |
| 133 | - * @param {boolean} [sticky] Keep it until the visitor closes it. | |
| 129 | + * @param {string} [type] 'error' (default) or 'success' — controls colour + icon. | |
| 134 | 130 | */ |
| 135 | - function showNotification( message, type, sticky ) { | |
| 131 | + function showNotification( message, type ) { | |
| 136 | 132 | type = type === 'success' ? 'success' : 'error'; |
| 137 | 133 | |
| 138 | 134 | var existing = document.querySelector( '.doi-error-notification' ); |
| 139 | 135 | if ( existing ) { |
| @@ -176,12 +172,8 @@ | ||
| 176 | 172 | // Trigger enter animation |
| 177 | 173 | requestAnimationFrame( function () { |
| 178 | 174 | notification.classList.add( 'doi-error-notification--visible' ); |
| 179 | 175 | } ); |
| 180 | - | |
| 181 | - if ( sticky ) { | |
| 182 | - return; | |
| 183 | - } | |
| 184 | 176 | |
| 185 | 177 | // Auto-dismiss after 10 seconds |
| 186 | 178 | setTimeout( function () { |
| 187 | 179 | dismiss( notification ); |