🐛(frontend) guard getRouteUrl('room', slug) against missing slug

InviteDialog.tsx and Info.tsx were the last call sites calling
getRouteUrl('room', slug) without a slug guard, unlike every other
caller (e.g. useCopyRoomToClipboard).

Compute roomUrl only when the slug exists (undefined in
InviteDialog, '' in Info to keep its unguarded .replace safe).
Guarding at the call site preserves the "no room data yet" state
instead of returning a bogus "/" URL from room.to.

Fix 019fd616-f158-7771-8cff-bac3090b8449
This commit is contained in:
lebaudantoine
2026-08-06 18:03:01 +02:00
committed by aleb_the_flash
parent b8958e6e87
commit ea7188059d
2 changed files with 2 additions and 2 deletions
@@ -45,7 +45,7 @@ export const InviteDialog = ({ mode }: { mode: 'join' | 'create' }) => {
const { t } = useTranslation('rooms', { keyPrefix: 'shareDialog' })
const roomData = useRoomData()
const roomUrl = getRouteUrl('room', roomData?.slug)
const roomUrl = roomData?.slug ? getRouteUrl('room', roomData.slug) : ''
const telephony = useTelephony()
@@ -14,7 +14,7 @@ export const Info = () => {
const { t } = useTranslation('rooms', { keyPrefix: 'info' })
const data = useRoomData()
const roomUrl = getRouteUrl('room', data?.slug)
const roomUrl = data?.slug ? getRouteUrl('room', data.slug) : ''
const telephony = useTelephony()