Saúl Ibarra Corretgé 1feff9709c config: drop configLocation and getroomnode options
They never worked on mobile and pose an impediment for makinf config.js more
future proof. Specially if we want to move to a non-executable form of
configuration.
2019-10-14 12:20:58 +02:00

18 lines
420 B
JavaScript

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