Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
rk4718
wacc_26_web_client
Commits
1804891e
Commit
1804891e
authored
Mar 13, 2020
by
Raghav Khanna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compile error so custom runtime variables are accisible in react
parent
5b15d3c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
public/index.html
public/index.html
+4
-4
src/App.js
src/App.js
+6
-5
No files found.
public/index.html
View file @
1804891e
...
...
@@ -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.
...
...
src/App.js
View file @
1804891e
...
...
@@ -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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment