Skip to content

Commit

Permalink
fix: launch state error
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Jan 22, 2021
1 parent a090939 commit afb12f1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/assets/javascripts/views/application/application_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ApplicationViewCtrl extends PureViewCtrl<unknown, {
this.$location = $location;
this.$rootScope = $rootScope;
this.platformString = getPlatformString();
this.state = { appClass: '', challenges: [] };
this.state = this.getInitialState();
this.onDragDrop = this.onDragDrop.bind(this);
this.onDragOver = this.onDragOver.bind(this);
this.addDragDropHandlers();
Expand All @@ -58,12 +58,20 @@ class ApplicationViewCtrl extends PureViewCtrl<unknown, {
this.loadApplication();
}

getInitialState() {
return {
appClass: '',
challenges: [],
};
}

async loadApplication() {
this.application!.componentManager!.setDesktopManager(
this.application!.getDesktopService()
);
await this.application!.prepareForLaunch({
receiveChallenge: async (challenge) => {

this.setState({
challenges: this.state.challenges.concat(challenge)
});
Expand Down

0 comments on commit afb12f1

Please sign in to comment.