MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / notify

Function notify

apps/web/utilities/notification.ts:14–31  ·  view source on GitHub ↗
(
  text: string,
  callbackUrl: string,
  callbackFn: (callbackUrl: string) => void = defaultCallback
)

Source from the content-addressed store, hash-verified

12};
13
14export const notify = (
15 text: string,
16 callbackUrl: string,
17 callbackFn: (callbackUrl: string) => void = defaultCallback
18): void => {
19 console.log({ text, callbackUrl });
20 if (window.Notification && isNotificationEnabled()) {
21 const notification = new window.Notification('Linen Notification', {
22 body: text,
23 });
24 if (!!callbackUrl) {
25 notification.onclick = (event) => {
26 event.preventDefault();
27 callbackFn(callbackUrl);
28 };
29 }
30 }
31};

Callers 2

PageLayoutFunction · 0.90
onNewMessageFunction · 0.85

Calls 2

isNotificationEnabledFunction · 0.85
logMethod · 0.65

Tested by

no test coverage detected