diff --git a/demo/client.ts b/demo/client.ts index 5b561a8c97..1f8ac41741 100644 --- a/demo/client.ts +++ b/demo/client.ts @@ -302,7 +302,7 @@ function createTerminal(): void { }); // fit is called within a setTimeout, cols and rows need this. - setTimeout(() => { + setTimeout(async () => { initOptions(term); // TODO: Clean this up, opt-cols/rows doesn't exist anymore (document.getElementById(`opt-cols`) as HTMLInputElement).value = term.cols; @@ -312,16 +312,14 @@ function createTerminal(): void { // Set terminal size again to set the specific dimensions on the demo updateTerminalSize(); - fetch('/terminals?cols=' + term.cols + '&rows=' + term.rows, { method: 'POST' }).then((res) => { - res.text().then((processId) => { - pid = processId; - socketURL += processId; - socket = new WebSocket(socketURL); - socket.onopen = runRealTerminal; - socket.onclose = runFakeTerminal; - socket.onerror = runFakeTerminal; - }); - }); + const res = await fetch('/terminals?cols=' + term.cols + '&rows=' + term.rows, { method: 'POST' }); + const processId = await res.text(); + pid = processId; + socketURL += processId; + socket = new WebSocket(socketURL); + socket.onopen = runRealTerminal; + socket.onclose = runFakeTerminal; + socket.onerror = runFakeTerminal; }, 0); } diff --git a/demo/index.html b/demo/index.html index a65b8bbc2d..83877d2288 100644 --- a/demo/index.html +++ b/demo/index.html @@ -10,8 +10,6 @@ - -