(href: string)
| 8 | export const LIVE_CHAT_JOIN_VALUE = 'join'; |
| 9 | |
| 10 | export 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. |
| 22 | export const getChatRoomPath = (roomId: string): string => `/chat/${roomId}`; |
no outgoing calls
no test coverage detected