Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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. }