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