(newNotification: NewNotification)
| 56 | }; |
| 57 | |
| 58 | const addToQueue = (newNotification: NewNotification) => { |
| 59 | if (!newNotification || registeredNotification[newNotification.id]) { |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | registeredNotification[newNotification.id] = true; |
| 64 | incrementUnreadCount(); |
| 65 | queue.push(newNotification); |
| 66 | if (queue.length >= MAX_QUEUE_LENGTH) { |
| 67 | queue.shift(); |
| 68 | } |
| 69 | if (!hasNotification()) { |
| 70 | displayNotification(queue.shift()); |
| 71 | } |
| 72 | }; |
| 73 | |
| 74 | const dismissNotification = () => { |
| 75 | if (queue.length) { |
no test coverage detected