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

Function onCopyLink

packages/shared/src/components/post/PostMenuOptions.tsx:39–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 const { logEvent } = useLogContext();
38
39 const onCopyLink = () => {
40 logEvent(
41 postLogEvent(LogEvent.SharePost, post, {
42 extra: { provider: ShareProvider.CopyLink, origin },
43 }),
44 );
45 // `shorten`, not an awaited short URL: awaiting the shortener first ends
46 // the task that handled the click, and Safari refuses the write after
47 // that. The permalink lands immediately and the tracked link replaces it.
48 copyLink({
49 link: post.commentsPermalink,
50 shorten: true,
51 cid: ReferralCampaignKey.SharePost,
52 });
53 };
54
55 return (
56 <>

Callers

nothing calls this directly

Calls 3

postLogEventFunction · 0.90
logEventFunction · 0.85
copyLinkFunction · 0.70

Tested by

no test coverage detected