Skip to content

Commit 5363ffe

Browse files
srcdevCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 9c70d7a commit 5363ffe

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

app/components/01.atoms/toast/DisplayToastProvider.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ watch(
101101
queue,
102102
(newQueue) => {
103103
const entries = newQueue as ToastQueueEntry[];
104+
105+
// Clear timers for entries that no longer exist (e.g. clear()).
106+
const entryIds = new Set(entries.map((e) => e.id));
107+
for (const [id, timer] of timers) {
108+
if (!entryIds.has(id)) {
109+
clearTimeout(timer);
110+
timers.delete(id);
111+
}
112+
}
113+
104114
const visibleCount = entries.filter((e) => e.status === "visible").length;
105115
const slots = props.maxVisible - visibleCount;
106116
const pending = entries.filter((e) => e.status === "pending");

0 commit comments

Comments
 (0)