aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/lib/components/OutputPane.svelte
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-02-23 23:29:14 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-02-23 23:29:14 +0100
commitbfc2263c7ccb44f636d2e7156dd61dd749bc7131 (patch)
tree2eec42b3c8fde2ae5d9d9b730cb62356ba7cb234 /web/pw-server/src/lib/components/OutputPane.svelte
parent816b3bfc277dbdde0716fcd8946bb13440d67767 (diff)
downloadplanetwars.dev-bfc2263c7ccb44f636d2e7156dd61dd749bc7131.tar.xz
planetwars.dev-bfc2263c7ccb44f636d2e7156dd61dd749bc7131.zip
show match pane when a match is selected
Diffstat (limited to 'web/pw-server/src/lib/components/OutputPane.svelte')
-rw-r--r--web/pw-server/src/lib/components/OutputPane.svelte8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/pw-server/src/lib/components/OutputPane.svelte b/web/pw-server/src/lib/components/OutputPane.svelte
index c72a22e..4123902 100644
--- a/web/pw-server/src/lib/components/OutputPane.svelte
+++ b/web/pw-server/src/lib/components/OutputPane.svelte
@@ -1,7 +1,11 @@
<script lang="ts">
export let matchLog: string;
- function getStdErr(log: string, botId: number): string {
+ function getStdErr(botId: number, log?: string): string {
+ if (!log) {
+ return "";
+ }
+
let output = [];
log
.split("\n")
@@ -15,7 +19,7 @@
return output.join("\n");
}
- $: botStdErr = getStdErr(matchLog, 1);
+ $: botStdErr = getStdErr(1, matchLog);
</script>
<div class="output">