You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getRoomName.js 420B

1234567891011121314151617
  1. // @flow
  2. import { getBackendSafeRoomName } from '../util';
  3. /**
  4. * Builds and returns the room name.
  5. *
  6. * @returns {string}
  7. */
  8. export default function getRoomName(): ?string {
  9. const path = window.location.pathname;
  10. // The last non-directory component of the path (name) is the room.
  11. const roomName = path.substring(path.lastIndexOf('/') + 1) || undefined;
  12. return getBackendSafeRoomName(roomName);
  13. }