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

Function logEventEnd

packages/shared/src/hooks/log/useLogContextData.ts:70–85  ·  view source on GitHub ↗
(id, now = new Date())

Source from the content-addressed store, hash-verified

68 }
69 },
70 logEventEnd(id, now = new Date()) {
71 const event = durationEventsQueue.current.get(id);
72 if (event) {
73 if (!event.event_timestamp) {
74 throw new Error('Missing event timestamp for duration event');
75 }
76
77 durationEventsQueue.current.delete(id);
78 event.event_duration =
79 now.getTime() - event.event_timestamp.getTime();
80 if (window.scrollY > 0 && event.event_name !== 'page inactive') {
81 event.page_state = 'active';
82 }
83 pushToQueue([event]);
84 }
85 },
86 sendBeacon,
87 }),
88 [sharedPropsRef, getPage, pushToQueue, durationEventsQueue, sendBeacon],

Callers 4

callbackFunction · 0.85
useLogPageViewFunction · 0.85
useAutoRotatingAdsFunction · 0.85
useLogImpressionFunction · 0.85

Calls

no outgoing calls

Tested by 1

callbackFunction · 0.68