Skip to content

Commit

Permalink
prevent simulator start on the home screen (#9716)
Browse files Browse the repository at this point in the history
  • Loading branch information
riknoll authored Oct 10, 2023
1 parent c8c1b7a commit c1f1590
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions webapp/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3704,17 +3704,18 @@ export class ProjectView
}
}

startSimulator(opts?: pxt.editor.SimulatorStartOptions) {
async startSimulator(opts?: pxt.editor.SimulatorStartOptions) {
pxt.tickEvent('simulator.start');
const isDebugMatch = !this.debugOptionsChanged();
const clickTrigger = opts && opts.clickTrigger;
pxt.debug(`start sim (autorun ${this.state.autoRun})`)
if (!this.shouldStartSimulator() && isDebugMatch) {
if (!this.shouldStartSimulator() && isDebugMatch || this.state.home) {
pxt.log("Ignoring call to start simulator, either already running or we shouldn't start.");
return Promise.resolve();
return;
}
return this.saveFileAsync()
.then(() => this.runSimulator({ debug: this.state.debugging, clickTrigger }))

await this.saveFileAsync();
await this.runSimulator({ debug: this.state.debugging, clickTrigger });
}

debugOptionsChanged() {
Expand Down

0 comments on commit c1f1590

Please sign in to comment.