From 01efd372e95628d419575ade0e6536a458fd61d2 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Sat, 8 Jan 2022 14:31:58 -0600 Subject: [PATCH] Logs button reopens log window --- src/ui/React/LogBoxManager.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ui/React/LogBoxManager.tsx b/src/ui/React/LogBoxManager.tsx index 0db405108..5dcd4c7ef 100644 --- a/src/ui/React/LogBoxManager.tsx +++ b/src/ui/React/LogBoxManager.tsx @@ -39,12 +39,14 @@ export function LogBoxManager(): React.ReactElement { () => LogBoxEvents.subscribe((script: RunningScript) => { const id = script.server + "-" + script.filename + script.args.map((x: any): string => `${x}`).join("-"); - if (logs.find((l) => l.id === id)) return; - logs.push({ - id: id, - script: script, - }); - rerender(); + if (logs.find((l) => l.id === id)) close(id); + Promise.resolve().then(() => { + logs.push({ + id: id, + script: script, + }); + rerender(); + }) }), [], );