Commit f6fdd33e authored by Raghav Khanna's avatar Raghav Khanna

Defualt to asking for user input from window prompt if no fresh input is currently set

parent 1804891e
......@@ -10,8 +10,7 @@
content="Web site created using create-react-app"
/>
<script>
var EMULATOR_CONSOLE_READ = "";
var EMULATOR_IS_INPUT = false;
var EMULATOR_CONSOLE_READ = () => { return window.prompt()};
</script>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
......
......@@ -65,12 +65,11 @@ class App extends React.Component {
readInputCallBack = (codeToEval) => {
console.log(test);
if (!window.EMULATOR_IS_INPUT) {
window.EMULATOR_CONSOLE_READ = window.prompt()
}
// if (!window.EMULATOR_IS_INPUT) {
// window.EMULATOR_CONSOLE_READ = window.prompt()
// }
eval(codeToEval);
window.EMULATOR_CONSOLE_READ = "";
window.EMULATOR_IS_INPUT = false;
window.EMULATOR_CONSOLE_READ = () => { return window.prompt()};
};
processWaccCode = async (code) => {
......@@ -170,7 +169,7 @@ class App extends React.Component {
}}
>
<Terminal commandPassThrough={cmd => {
window.EMULATOR_CONSOLE_READ = cmd[0];
window.EMULATOR_CONSOLE_READ = () => {return cmd[0]};
window.EMULATOR_IS_INPUT = true;
}} watchConsoleLogging hideTopBar allowTabs={false}/>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment