From be218575e9bd4e029d8cf228e30f1b8abe7c4908 Mon Sep 17 00:00:00 2001
From: Jakob Stendahl <14180120+JakobST1n@users.noreply.github.com>
Date: Mon, 11 Oct 2021 07:54:07 +0200
Subject: :lipstick: Clear output box when mode restarts

---
 src_frontend/Components/Editor/Output.svelte | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src_frontend/Components/Editor/Output.svelte')

diff --git a/src_frontend/Components/Editor/Output.svelte b/src_frontend/Components/Editor/Output.svelte
index dcd5995..9e4c953 100644
--- a/src_frontend/Components/Editor/Output.svelte
+++ b/src_frontend/Components/Editor/Output.svelte
@@ -22,6 +22,8 @@
             scrollBox.scrollTop = scrollBox.scrollHeight + 100;
         }
     }
+    
+    authorizedSocket.on("editor:proc:start", () => htmlCode = "");
     authorizedSocket.on("editor:proc:exit", (code) => addData(`\nMode exited with ${code}\n\n`, "exit"));
     authorizedSocket.on("editor:proc:stdout", (stdout) => addData(stdout, "stdout"));
     authorizedSocket.on("editor:proc:stderr", (stderr) => addData(stderr, "stderr"));
@@ -51,4 +53,4 @@
     <pre bind:this={scrollBox}>
         {@html htmlCode}
     </pre>
-</div>
\ No newline at end of file
+</div>
-- 
cgit v1.2.3

