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

getRoomName.ts 425B

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