* Closes a toast.
(key: string)
| 133 | * Closes a toast. |
| 134 | */ |
| 135 | close(key: string): void { |
| 136 | let index = this.queue.findIndex(t => t.key === key); |
| 137 | if (index >= 0) { |
| 138 | this.queue[index].onClose?.(); |
| 139 | this.queue.splice(index, 1); |
| 140 | } |
| 141 | |
| 142 | this.updateVisibleToasts('remove'); |
| 143 | } |
| 144 | |
| 145 | private updateVisibleToasts(action: ToastAction) { |
| 146 | this.visibleToasts = this.queue.slice(0, this.maxVisibleToasts); |
no test coverage detected