From bfc2263c7ccb44f636d2e7156dd61dd749bc7131 Mon Sep 17 00:00:00 2001
From: Ilion Beyst <ilion.beyst@gmail.com>
Date: Wed, 23 Feb 2022 23:29:14 +0100
Subject: show match pane when a match is selected

---
 web/pw-server/src/lib/components/Visualizer.svelte | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'web/pw-server/src/lib/components/Visualizer.svelte')

diff --git a/web/pw-server/src/lib/components/Visualizer.svelte b/web/pw-server/src/lib/components/Visualizer.svelte
index 1e8d09f..a1da923 100644
--- a/web/pw-server/src/lib/components/Visualizer.svelte
+++ b/web/pw-server/src/lib/components/Visualizer.svelte
@@ -1,5 +1,5 @@
 <script lang="ts">
-  import { onMount } from "svelte";
+  import { onDestroy, onMount } from "svelte";
   import * as visualizer from "pw-visualizer";
   import init_wasm_module from "planetwars-rs";
 
@@ -15,6 +15,11 @@
     visualizer.set_loading(false);
   });
 
+  onDestroy(() => {
+    // TODO: do a more thorough cleanup
+    visualizer.stop();
+  });
+
   $: if (initialized) {
     if (matchLog === null) {
       visualizer.set_loading(true);
-- 
cgit v1.2.3

