mirror of
https://github.com/hazemKrimi/touch-programming.git
synced 2026-05-01 18:20:26 +00:00
Attempt at controlling formatting constraints
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Code Typing Test Component</title>
|
||||
<title>Touch Programming</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
+4
-1
@@ -11,7 +11,9 @@ function App() {
|
||||
|
||||
useEffect(() => {
|
||||
(async function() {
|
||||
const response = await fetch(`${import.meta.env.VITE_API_URL}/generate?lang=scala&lines=20`);
|
||||
setCode('');
|
||||
|
||||
const response = await fetch(`${import.meta.env.VITE_API_URL}/generate?lang=go&lines=10`);
|
||||
const reader = response.body.getReader();
|
||||
const decoder = new TextDecoder();
|
||||
|
||||
@@ -22,6 +24,7 @@ function App() {
|
||||
|
||||
if (done) {
|
||||
setLoaded(true);
|
||||
setCode(prev => prev.trim());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user