[WIP] Hide simulator when editor is hidden to mute it#854
[WIP] Hide simulator when editor is hidden to mute it#854microbit-grace wants to merge 5 commits into
Conversation
- Hides simulator when landing on a page that is not the code page - Shows simulator when landing/navigating to code page - Hides simulator onBack from code page Fixes #772
| // Wait for simulator to finish hiding before showing simulator. | ||
| await hideSimulatorPromiseRef.current; | ||
| await driverRef.current?.showSimulator(); |
There was a problem hiding this comment.
Despite this wait, it doesn't work. Navigating quickly to code page straight after loading testing model page doesn't show the simulator. It causes the simulator to disappear from the editor. The user would need to toggle the showing/hiding of the simulator to get it to become visible again.
There was a problem hiding this comment.
Perhaps listening to the simevent would help (see potential editor sim events) in getting a more accurate indication of the sim state, but there's a comment in makecode-embed saying that it doesn't get fired.
Getting the simevent would also help in potentially being able to use stopSimulator instead of hideSimulator. I used hide because it stops the simulator from loading without needing to figure out when the sim is loaded. Stop simulator would require knowing when the simulator is loaded before calling it so that it can take effect.
|
Preview build will be at |
Fixes #772