fix: small performance tweaks
Some checks failed
Release / app (push) Has been cancelled

This commit is contained in:
2024-12-06 13:22:13 +00:00
parent 897bb46706
commit 0901e54ab6
8 changed files with 20 additions and 54 deletions

View File

@ -36,8 +36,11 @@ class ToasterSlots extends ExternalStore<Array<ToastNotification>> {
#eatToast() {
const now = unixNow();
this.#stack = this.#stack.filter(a => (a.expire ?? 0) > now);
this.notifyChange();
const newStack = this.#stack.filter(a => (a.expire ?? 0) > now);
if (newStack.length !== this.#stack.length) {
this.#stack = newStack;
this.notifyChange();
}
}
}