From dcb00b53a4801cbd4c7d45582ef90143b83e7ce6 Mon Sep 17 00:00:00 2001 From: Thomas Sparks <69657545+thsparks@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:27:11 -0700 Subject: [PATCH] Do Not Expand Sim After Tutorial in Headless Mode (#9644) When a tutorial ends and the user clicks "Done" to go to the main code editor, we were calling into expandSimulator, which will open the sidebar even when we don't have an actual simulator to show. This change prevents that call if we're in headless mode (i.e. no simulator). I considered putting this check inside expandSimulator so it no-oped there if we're in headless mode, but I think this may still be used to see the file explorer in javascript mode, so I left that untouched for now. --- webapp/src/app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/app.tsx b/webapp/src/app.tsx index 78d809a23d83..dafc9cd99e7a 100644 --- a/webapp/src/app.tsx +++ b/webapp/src/app.tsx @@ -4658,7 +4658,7 @@ export class ProjectView return this.loadHeaderAsync(curr); }).finally(() => { core.hideLoading("leavingtutorial") - if (this.state.collapseEditorTools) { + if (this.state.collapseEditorTools && !pxt.appTarget.simulator.headless) { this.expandSimulator(); } this.postTutorialProgress();