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

Function logAndCopyLink

packages/shared/src/hooks/useSquadInvitation.ts:46–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 const [copying, copyLink] = useCopyLink(() => invitation);
45
46 const logAndCopyLink = async () => {
47 logEvent({
48 event_name: LogEvent.ShareSquadInvitation,
49 extra: JSON.stringify({ origin, squad: squad.id }),
50 });
51
52 completeAction(ActionType.SquadInvite);
53
54 if (invitation) {
55 return copyLink();
56 }
57
58 // Safari may refuse a clipboard write that follows a request, which is
59 // why callers load the link before the click.
60 const link = await queryClient
61 .fetchQuery(queryOptions)
62 .catch((): null => null);
63
64 return copyLink({ link: link ?? undefined });
65 };
66
67 return {
68 invitation,

Callers

nothing calls this directly

Calls 2

logEventFunction · 0.85
copyLinkFunction · 0.50

Tested by

no test coverage detected