Skip to content

Commit ccf2d04

Browse files
committed
fix initialized before completed and await in language menu
1 parent 68d6aef commit ccf2d04

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/managers/gameManager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,11 @@ export default class GameManager {
522522
return statement;
523523
}
524524

525-
InitializedGame() {
525+
async InitializedGame() {
526526
this.startedTime=new Date();
527527
this.Initialized=true;
528-
completableXapiTracker.enqueue(completableXapiTracker.Initialized("ConnectadoWeb",COMPLETABLETYPE.GAME));
529-
xapiTracker.sendBatch();
528+
await completableXapiTracker.enqueue(completableXapiTracker.Initialized("ConnectadoWeb",COMPLETABLETYPE.GAME));
529+
await xapiTracker.sendBatch();
530530
}
531531

532532
ProgressedGame() {

src/scenes/menus/languageMenu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ export default class LanguageMenu extends Phaser.Scene {
4646

4747
// Boton de salir
4848
let exitButton = new Button(this, 100, 3 * CANVAS_HEIGHT / 4 + 10, 0.5,
49-
() => {
49+
async () => {
5050
if(!this.gameManager.initialized) {
51-
this.gameManager.InitializedGame();
51+
await this.gameManager.InitializedGame();
5252
}
5353
this.gameManager.CompletedGame(true);
5454
},

0 commit comments

Comments
 (0)