MCPcopy Index your code
hub / github.com/codeaashu/claude-code / useBuddyNotification

Function useBuddyNotification

src/buddy/useBuddyNotification.tsx:43–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 return <Text key={i} color={getRainbowColor(i)}>{ch}</Text>;
42}
43export function useBuddyNotification() {
44 const $ = _c(4);
45 const {
46 addNotification,
47 removeNotification
48 } = useNotifications();
49 let t0;
50 let t1;
51 if ($[0] !== addNotification || $[1] !== removeNotification) {
52 t0 = () => {
53 if (!feature("BUDDY")) {
54 return;
55 }
56 const config = getGlobalConfig();
57 if (config.companion || !isBuddyTeaserWindow()) {
58 return;
59 }
60 addNotification({
61 key: "buddy-teaser",
62 jsx: <RainbowText text="/buddy" />,
63 priority: "immediate",
64 timeoutMs: 15000
65 });
66 return () => removeNotification("buddy-teaser");
67 };
68 t1 = [addNotification, removeNotification];
69 $[0] = addNotification;
70 $[1] = removeNotification;
71 $[2] = t0;
72 $[3] = t1;
73 } else {
74 t0 = $[2];
75 t1 = $[3];
76 }
77 useEffect(t0, t1);
78}
79export function findBuddyTriggerPositions(text: string): Array<{
80 start: number;
81 end: number;

Callers 1

PromptInputFunction · 0.85

Calls 4

featureFunction · 0.85
getGlobalConfigFunction · 0.85
isBuddyTeaserWindowFunction · 0.85
useNotificationsFunction · 0.50

Tested by

no test coverage detected