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

Function withJoinIntent

packages/shared/src/features/liveChat/joinLink.ts:10–19  ·  view source on GitHub ↗
(href: string)

Source from the content-addressed store, hash-verified

8export const LIVE_CHAT_JOIN_VALUE = 'join';
9
10export const withJoinIntent = (href: string): string => {
11 try {
12 const url = new URL(href);
13 url.searchParams.set(LIVE_CHAT_JOIN_PARAM, LIVE_CHAT_JOIN_VALUE);
14 return url.toString();
15 } catch {
16 const separator = href.includes('?') ? '&' : '?';
17 return `${href}${separator}${LIVE_CHAT_JOIN_PARAM}=${LIVE_CHAT_JOIN_VALUE}`;
18 }
19};
20
21// The chat page of a topic room; a post room lives on its post.
22export const getChatRoomPath = (roomId: string): string => `/chat/${roomId}`;

Callers 2

joinLink.spec.tsFile · 0.90
getChatRoomHrefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected