Logs button reopens log window

This commit is contained in:
nickofolas 2022-01-08 14:31:58 -06:00
parent ea5e142fa1
commit 01efd372e9

@ -39,12 +39,14 @@ export function LogBoxManager(): React.ReactElement {
() => () =>
LogBoxEvents.subscribe((script: RunningScript) => { LogBoxEvents.subscribe((script: RunningScript) => {
const id = script.server + "-" + script.filename + script.args.map((x: any): string => `${x}`).join("-"); const id = script.server + "-" + script.filename + script.args.map((x: any): string => `${x}`).join("-");
if (logs.find((l) => l.id === id)) return; if (logs.find((l) => l.id === id)) close(id);
logs.push({ Promise.resolve().then(() => {
id: id, logs.push({
script: script, id: id,
}); script: script,
rerender(); });
rerender();
})
}), }),
[], [],
); );