Merge branch 'develop' of github.com:thecodingmachine/workadventure
This commit is contained in:
@@ -610,17 +610,16 @@ class CoWebsiteManager {
|
||||
}
|
||||
}
|
||||
|
||||
public closeCoWebsites(): Promise<void> {
|
||||
this.currentOperationPromise = this.currentOperationPromise.then(() => {
|
||||
const promises: Promise<void>[] = [];
|
||||
this.coWebsites.forEach((coWebsite: CoWebsite) => {
|
||||
promises.push(this.closeCoWebsite(coWebsite));
|
||||
});
|
||||
return Promise.all(promises).then(() => {
|
||||
return;
|
||||
});
|
||||
public async closeCoWebsites(): Promise<void> {
|
||||
await this.currentOperationPromise;
|
||||
|
||||
const promises: Promise<void>[] = [];
|
||||
this.coWebsites.forEach((coWebsite: CoWebsite) => {
|
||||
promises.push(this.closeCoWebsite(coWebsite));
|
||||
});
|
||||
return this.currentOperationPromise;
|
||||
await Promise.all(promises);
|
||||
// TODO: this.currentOperationPromise does not point any more on the last promise
|
||||
return;
|
||||
}
|
||||
|
||||
public getGameSize(): { width: number; height: number } {
|
||||
|
||||
@@ -62,7 +62,7 @@ function hsv_to_rgb(hue: number, saturation: number, brightness: number): { r: n
|
||||
b = q;
|
||||
break;
|
||||
default:
|
||||
throw "h_i cannot be " + h_i;
|
||||
throw new Error("h_i cannot be " + h_i);
|
||||
}
|
||||
return {
|
||||
r,
|
||||
|
||||
@@ -22,7 +22,7 @@ export function getNavigatorType(): NavigatorType {
|
||||
} else if (window.navigator.userAgent.includes("Safari")) {
|
||||
return NavigatorType.safari;
|
||||
}
|
||||
throw "Couldn't detect navigator type";
|
||||
throw new Error("Couldn't detect navigator type");
|
||||
}
|
||||
export function isAndroid(): boolean {
|
||||
return window.navigator.userAgent.includes("Android");
|
||||
|
||||
@@ -123,7 +123,7 @@ export class SimplePeer {
|
||||
peerConnection.destroy();
|
||||
const peerConnexionDeleted = this.PeerConnectionArray.delete(user.userId);
|
||||
if (!peerConnexionDeleted) {
|
||||
throw "Error to delete peer connection";
|
||||
throw new Error("Error to delete peer connection");
|
||||
}
|
||||
//return this.createPeerConnection(user, localStream);
|
||||
} else {
|
||||
@@ -177,7 +177,7 @@ export class SimplePeer {
|
||||
peerConnection.destroy();
|
||||
const peerConnexionDeleted = this.PeerScreenSharingConnectionArray.delete(user.userId);
|
||||
if (!peerConnexionDeleted) {
|
||||
throw "Error to delete peer connection";
|
||||
throw new Error("Error to delete peer connection");
|
||||
}
|
||||
this.createPeerConnection(user);
|
||||
} else {
|
||||
@@ -229,7 +229,7 @@ export class SimplePeer {
|
||||
|
||||
const userIndex = this.Users.findIndex((user) => user.userId === userId);
|
||||
if (userIndex < 0) {
|
||||
throw "Couldn't delete user";
|
||||
throw new Error("Couldn't delete user");
|
||||
} else {
|
||||
this.Users.splice(userIndex, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user