Skip to content
Snippets Groups Projects
Commit a286aa09 authored by jonasled's avatar jonasled
Browse files

fix error.ts gets alwaysExecuted

parent bb4479f8
Branches
Tags
No related merge requests found
......@@ -56,5 +56,8 @@ if (strpos($_SERVER['HTTP_HOST'], '.onion') !== false) {
];
</script>
<script src="/js/script.js"></script>
<script>
startNewTask();
</script>
</body>
</html>
\ No newline at end of file
......@@ -59,6 +59,9 @@ function getError500()
];
</script>
<script src="/js/script.js"></script>
<script>
startNewTask();
</script>
</body>
</html>
EOF;
......
......@@ -2,14 +2,14 @@ import Timeout = NodeJS.Timeout;
let intervalTime = 150;
let terminal:HTMLElement = <HTMLElement> document.getElementsByClassName("terminal")[0];
let historyContainer:HTMLElement = <HTMLElement> terminal.getElementsByClassName("history")[0];
let promptContainer:HTMLElement = <HTMLElement> terminal.getElementsByClassName("prompt")[0];
let dataIndex = 0;
let stringPosition = 0;
let printTask: Timeout;
let terminal:HTMLElement;
let historyContainer:HTMLElement;
let promptContainer:HTMLElement;
function writeOut() {
// @ts-ignore
......@@ -33,7 +33,9 @@ function writeOut() {
}
function startNewTask() {
terminal = <HTMLElement> document.getElementsByClassName("terminal")[0];
historyContainer = <HTMLElement> terminal.getElementsByClassName("history")[0];
promptContainer = <HTMLElement> terminal.getElementsByClassName("prompt")[0];
printTask = setInterval(writeOut, intervalTime);
}
\ No newline at end of file
startNewTask();
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment