jiti-meet/react/features/base/config/getRoomName.ts

16 lines
425 B
TypeScript
Raw Normal View History

import { getBackendSafeRoomName } from '../util/uri';
2019-10-04 07:31:22 +00:00
/**
* Builds and returns the room name.
*
* @returns {string}
*/
export default function getRoomName(): string | undefined {
const path = window.location.pathname;
// The last non-directory component of the path (name) is the room.
const roomName = path.substring(path.lastIndexOf('/') + 1) || undefined;
2019-10-04 07:31:22 +00:00
return getBackendSafeRoomName(roomName);
}