Added the user-room token created from admin when we access a room
This commit is contained in:
parent
9eb4206fe0
commit
dd79f7d0f4
13 changed files with 63 additions and 2 deletions
|
@ -20,6 +20,12 @@ export const setTags = (_tags: string[]) => {
|
|||
|
||||
let uuid: string | undefined;
|
||||
|
||||
let userRoomToken: string | undefined;
|
||||
|
||||
export const setUserRoomToken = (token: string | undefined) => {
|
||||
userRoomToken = token;
|
||||
};
|
||||
|
||||
export const setUuid = (_uuid: string | undefined) => {
|
||||
uuid = _uuid;
|
||||
};
|
||||
|
@ -67,6 +73,13 @@ export class WorkadventurePlayerCommands extends IframeApiContribution<Workadven
|
|||
}
|
||||
return uuid;
|
||||
}
|
||||
|
||||
get userRoomToken(): string | undefined {
|
||||
if (userRoomToken === undefined) {
|
||||
throw new Error("User-room token not initialized yet. You should call WA.player.userRoomToken within a WA.onInit callback.");
|
||||
}
|
||||
return userRoomToken;
|
||||
}
|
||||
}
|
||||
|
||||
export default new WorkadventurePlayerCommands();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue