fix: launch state error
This commit is contained in:
@@ -36,7 +36,7 @@ class ApplicationViewCtrl extends PureViewCtrl<unknown, {
|
|||||||
this.$location = $location;
|
this.$location = $location;
|
||||||
this.$rootScope = $rootScope;
|
this.$rootScope = $rootScope;
|
||||||
this.platformString = getPlatformString();
|
this.platformString = getPlatformString();
|
||||||
this.state = { appClass: '', challenges: [] };
|
this.state = this.getInitialState();
|
||||||
this.onDragDrop = this.onDragDrop.bind(this);
|
this.onDragDrop = this.onDragDrop.bind(this);
|
||||||
this.onDragOver = this.onDragOver.bind(this);
|
this.onDragOver = this.onDragOver.bind(this);
|
||||||
this.addDragDropHandlers();
|
this.addDragDropHandlers();
|
||||||
@@ -58,12 +58,20 @@ class ApplicationViewCtrl extends PureViewCtrl<unknown, {
|
|||||||
this.loadApplication();
|
this.loadApplication();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getInitialState() {
|
||||||
|
return {
|
||||||
|
appClass: '',
|
||||||
|
challenges: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
async loadApplication() {
|
async loadApplication() {
|
||||||
this.application!.componentManager!.setDesktopManager(
|
this.application!.componentManager!.setDesktopManager(
|
||||||
this.application!.getDesktopService()
|
this.application!.getDesktopService()
|
||||||
);
|
);
|
||||||
await this.application!.prepareForLaunch({
|
await this.application!.prepareForLaunch({
|
||||||
receiveChallenge: async (challenge) => {
|
receiveChallenge: async (challenge) => {
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
challenges: this.state.challenges.concat(challenge)
|
challenges: this.state.challenges.concat(challenge)
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user