Skip to content

Commit

Permalink
fix popState()
Browse files Browse the repository at this point in the history
  • Loading branch information
minecrawler committed Nov 4, 2020
1 parent 7743871 commit 9803f66
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/world.ts
Expand Up @@ -284,7 +284,15 @@ export class World implements IWorld {

protected async popState(): Promise<void> {
await this.pda.pop()?.deactivate(this.transitionWorld);
await this.pda.state?.activate(this.transitionWorld);

const newState = this.pda.state;
if (!newState) {
this.runExecutionPipeline = [];
return;
}

await newState.activate(this.transitionWorld);
this.runExecutionPipeline = this.runExecutionPipelineCache.get(newState) ?? [];
}

// todo: improve logic which sets up the groups (tracked by #13)
Expand Down

0 comments on commit 9803f66

Please sign in to comment.