theluyuan 38ba663466
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
init
2025-09-02 14:49:16 +08:00

16 lines
425 B
TypeScript

import { getBackendSafeRoomName } from '../util/uri';
/**
* Builds and returns the room name.
*
* @returns {string}
*/
export default function getRoomName(): string | undefined {
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;
return getBackendSafeRoomName(roomName);
}