diff --git a/umap/static/umap/js/components/alerts/alert.js b/umap/static/umap/js/components/alerts/alert.js index 517b7992..d47fc83d 100644 --- a/umap/static/umap/js/components/alerts/alert.js +++ b/umap/static/umap/js/components/alerts/alert.js @@ -57,8 +57,11 @@ class uMapAlert extends uMapElement { this.container.dataset.duration = duration this.element.textContent = message this.setAttribute('open', 'open') + if (this._timeoutId) { + clearTimeout(this._timeoutId) + } if (Number.isFinite(duration)) { - setTimeout(() => { + this._timeoutId = setTimeout(() => { this._hide() }, duration) }