您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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