diff --git a/front/src/Connection.ts b/front/src/Connection.ts index 1bd11948..cad639f9 100644 --- a/front/src/Connection.ts +++ b/front/src/Connection.ts @@ -158,7 +158,7 @@ export class Connection implements Connection { .then((res) => { return new Promise((resolve, reject) => { - let connection = new Connection(gameManager, name, characterSelected, res.data.token); + const connection = new Connection(gameManager, name, characterSelected, res.data.token); connection.onConnectError((error: object) => { console.log('An error occurred while connecting to socket server. Retrying'); @@ -199,7 +199,7 @@ export class Connection implements Connection { joinARoom(roomId: string, startX: number, startY: number, direction: string, moving: boolean): Promise { const point = new Point(startX, startY, direction, moving); this.lastPositionShared = point; - let promise = new Promise((resolve, reject) => { + const promise = new Promise((resolve, reject) => { this.socket.emit(EventMessage.JOIN_ROOM, { roomId, position: {x: startX, y: startY, direction, moving }}, (userPositions: MessageUserPositionInterface[]) => { //this.GameManager.initUsersPosition(userPositions); resolve(userPositions); diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 503de384..4a23a7c4 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -190,7 +190,7 @@ export class GameScene extends Phaser.Scene { this.simplePeer.closeAllConnections(); - let key = 'somekey'+Math.round(Math.random()*10000); + const key = 'somekey'+Math.round(Math.random()*10000); const game : Phaser.Scene = GameScene.createFromUrl(this.MapUrlFile, this.instance, key); this.scene.add(key, game, true, {