Adding exitUrl property
The exitUrl property can be applied on a layer to link to any kind of room (private or public)
This commit is contained in:
@@ -6,8 +6,10 @@ export class Room {
|
||||
public readonly isPublic: boolean;
|
||||
private mapUrl: string|undefined;
|
||||
private instance: string|undefined;
|
||||
public readonly hash: string;
|
||||
|
||||
constructor(id: string) {
|
||||
this.hash = '';
|
||||
if (id.startsWith('/')) {
|
||||
id = id.substr(1);
|
||||
}
|
||||
@@ -19,6 +21,13 @@ export class Room {
|
||||
} else {
|
||||
throw new Error('Invalid room ID');
|
||||
}
|
||||
|
||||
const indexOfHash = this.id.indexOf('#');
|
||||
if (indexOfHash !== -1) {
|
||||
const idWithHash = this.id;
|
||||
this.id = this.id.substr(0, indexOfHash);
|
||||
this.hash = idWithHash.substr(indexOfHash + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public async getMapUrl(): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user