MCPcopy Create free account
hub / github.com/dailydotdev/apps / addToQueue

Function addToQueue

packages/shared/src/hooks/useInAppNotification.ts:58–72  ·  view source on GitHub ↗
(newNotification: NewNotification)

Source from the content-addressed store, hash-verified

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) {

Callers 1

useInAppNotificationFunction · 0.85

Calls 3

hasNotificationFunction · 0.85
displayNotificationFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected