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:
parent
517b3a644b
commit
36d73333f5
6 changed files with 165 additions and 160 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue