remove instance, change room url, fix invalid lastRoomUrls
This commit is contained in:
@@ -145,6 +145,7 @@ class ConnectionManager {
|
||||
await this.checkAuthUserConnexion();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
await this.anonymousLogin();
|
||||
}
|
||||
}
|
||||
this.localUser = localUserStore.getLocalUser() as LocalUser; //if authToken exist in localStorage then localUser cannot be null
|
||||
@@ -172,8 +173,13 @@ class ConnectionManager {
|
||||
}
|
||||
|
||||
//get detail map for anonymous login and set texture in local storage
|
||||
this._currentRoom = await Room.createRoom(new URL(roomPath));
|
||||
if (this._currentRoom.textures != undefined && this._currentRoom.textures.length > 0) {
|
||||
try {
|
||||
this._currentRoom = await Room.createRoom(new URL(roomPath));
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
localUserStore.setLastRoomUrl(null);
|
||||
}
|
||||
if (this._currentRoom != undefined && this._currentRoom.textures != undefined && this._currentRoom.textures.length > 0) {
|
||||
//check if texture was changed
|
||||
if (this.localUser.textures.length === 0) {
|
||||
this.localUser.textures = this._currentRoom.textures;
|
||||
@@ -201,6 +207,7 @@ class ConnectionManager {
|
||||
}
|
||||
|
||||
public async anonymousLogin(isBenchmark: boolean = false): Promise<void> {
|
||||
localUserStore.setAuthToken(null);
|
||||
try {
|
||||
const data = await Axios.post(`${PUSHER_URL}/anonymLogin`).then((res) => res.data);
|
||||
this.localUser = new LocalUser(data.userUuid, []);
|
||||
|
||||
Reference in New Issue
Block a user