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

18 lines
420 B
JavaScript
Raw Normal View History

// @flow
2019-10-04 07:31:22 +00:00
import { getBackendSafeRoomName } from '../util';
/**
* Builds and returns the room name.
*
* @returns {string}
*/
export default function getRoomName(): ?string {
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);
}