diff --git a/CHANGELOG.md b/CHANGELOG.md index c6cb75430..b6fcaf03f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http: - Included past tense verbs in higher order functions. - Fixed aria-label updates. +- Drop old announcements if the queue exceeds three, preferering most recent. ## 0.10.10 2024-08-12 diff --git a/src/components/project/Announcer.svelte b/src/components/project/Announcer.svelte index 0dbe8dbec..4bb9b624d 100644 --- a/src/components/project/Announcer.svelte +++ b/src/components/project/Announcer.svelte @@ -23,6 +23,12 @@ // Is there a timeout? Wait for it to dequue. if (timeout) return; + // Have we fallen behind? Trim everything by the most recent. + if (announcements.length > 3) { + const mostRecent = announcements.shift(); + if (mostRecent) announcements = [mostRecent]; + } + // Grab the message of a different kind from the current message, or the next one if there aren't any. let next = announcements.pop(); announcements = [];