Commit 1804891e authored by Raghav Khanna's avatar Raghav Khanna

fix compile error so custom runtime variables are accisible in react

parent 5b15d3c2
......@@ -9,16 +9,16 @@
name="description"
content="Web site created using create-react-app"
/>
<script>
var EMULATOR_CONSOLE_READ = "";
var EMULATOR_IS_INPUT = false;
</script>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<script>
var EMULATOR_CONSOLE_READ = "";
var EMULATOR_IS_INPUT = false;
</script>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
......
......@@ -65,12 +65,12 @@ class App extends React.Component {
readInputCallBack = (codeToEval) => {
console.log(test);
if (!EMULATOR_IS_INPUT) {
EMULATOR_CONSOLE_READ = window.prompt()
if (!window.EMULATOR_IS_INPUT) {
window.EMULATOR_CONSOLE_READ = window.prompt()
}
eval(codeToEval);
EMULATOR_CONSOLE_READ = "";
EMULATOR_IS_INPUT = false;
window.EMULATOR_CONSOLE_READ = "";
window.EMULATOR_IS_INPUT = false;
};
processWaccCode = async (code) => {
......@@ -170,7 +170,8 @@ class App extends React.Component {
}}
>
<Terminal commandPassThrough={cmd => {
test = cmd[0]
window.EMULATOR_CONSOLE_READ = cmd[0];
window.EMULATOR_IS_INPUT = true;
}} watchConsoleLogging hideTopBar allowTabs={false}/>
</div>
</CardBody>
......
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