Skip to content

Commit

Permalink
properly set enginesBooted flag after boot callbacks have run
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Oct 3, 2024
1 parent 6704079 commit 4b6adca
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions addon/services/universe.js
Original file line number Diff line number Diff line change
Expand Up @@ -1867,8 +1867,9 @@ export default class UniverseService extends Service.extend(Evented) {
await tryBootEngine(extension);
}

this.runBootCallbacks(owner);
this.enginesBooted = true;
this.runBootCallbacks(owner, () => {
this.enginesBooted = true;
});
});
}

Expand Down Expand Up @@ -1953,8 +1954,9 @@ export default class UniverseService extends Service.extend(Evented) {
await tryBootEngine(extension);
}

this.runBootCallbacks(owner);
this.enginesBooted = true;
this.runBootCallbacks(owner, () => {
this.enginesBooted = true;
});
});
}

Expand Down Expand Up @@ -2004,7 +2006,11 @@ export default class UniverseService extends Service.extend(Evented) {
for (let i = 0; i < this.bootCallbacks.length; i++) {
const callback = this.bootCallbacks[i];
if (typeof callback === 'function') {
callback(this, appInstance);
try {
callback(this, appInstance);
} catch (error) {
debug(`Engine Boot Callback Error: ${error.message}`);
}
}
}

Expand Down

0 comments on commit 4b6adca

Please sign in to comment.