(
room: Pick<ChatRoom, 'id' | 'type'> & {
post?: { commentsPermalink?: string } | null;
},
)
| 25 | // a post room to the post, joining on landing. Undefined for a post room |
| 26 | // whose post is not known, which has nowhere to go. |
| 27 | export const getChatRoomHref = ( |
| 28 | room: Pick<ChatRoom, 'id' | 'type'> & { |
| 29 | post?: { commentsPermalink?: string } | null; |
| 30 | }, |
| 31 | ): string | undefined => { |
| 32 | if (room.type === ChatRoomType.Topic) { |
| 33 | return `${webappUrl}${getChatRoomPath(room.id).slice(1)}`; |
| 34 | } |
| 35 | |
| 36 | return room.post?.commentsPermalink |
| 37 | ? withJoinIntent(room.post.commentsPermalink) |
| 38 | : undefined; |
| 39 | }; |
| 40 | |
| 41 | // Where the daily.dev team opens a chat on a topic. Absolute, like the |
| 42 | // room links, since the widget renders in the extension too. |
no test coverage detected