Skip to content

Commit

Permalink
add missing awaits when calling switchToDefaultControls
Browse files Browse the repository at this point in the history
  • Loading branch information
BarthPaleologue committed Sep 16, 2024
1 parent a03d078 commit 73c497d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ts/blackHoleDemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ await starSystemView.loadStarSystem(starSystem, true);

engine.init(true);

starSystemView.switchToDefaultControls(true);
await starSystemView.switchToDefaultControls(true);

const BH = starSystem.stellarObjects[0];

Expand Down
4 changes: 2 additions & 2 deletions src/ts/ui/mainMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ export class MainMenu {
async init() {
await this.starSystemView.loadStarSystem(this.starSystemController, true, 0);

this.starSystemView.onInitStarSystem.addOnce(() => {
this.starSystemView.switchToDefaultControls(false);
this.starSystemView.onInitStarSystem.addOnce(async () => {
await this.starSystemView.switchToDefaultControls(false);
const nbRadius = this.starSystemController.model.getBodyTypeOfStellarObject(0) === BodyType.BLACK_HOLE ? 8 : 2;
const targetObject = getObjectBySystemId(this.universeObjectId, this.starSystemController);
if (targetObject === null) {
Expand Down

0 comments on commit 73c497d

Please sign in to comment.