Address PR comments on RoomForm

This commit is contained in:
mplorentz
2026-03-04 16:42:49 -05:00
parent 02b2ccdee3
commit 9c2d2093ec
4 changed files with 65 additions and 61 deletions
+21
View File
@@ -0,0 +1,21 @@
const livekitEndpoint = (url: string, groupId: string) => {
const httpUrl = url
.replace(/^wss:\/\//, "https://")
.replace(/^ws:\/\//, "http://")
.replace(/\/$/, "")
return `${httpUrl}/.well-known/nip29/livekit/${groupId}`
}
export const checkRelayHasLivekit = async (url: string): Promise<boolean> => {
const endpoint = livekitEndpoint(url, "nop")
try {
// Zooid returns 401 when livekit is configured and 404 if it is not.
const response = await fetch(endpoint)
return response.status === 401
} catch {
return false
}
}
export const getLivekitEndpoint = (url: string, groupId: string) => livekitEndpoint(url, groupId)