Clear timeout when destroying/navigating away from page

This commit is contained in:
2023-06-03 13:30:34 +02:00
parent e4edc6c78e
commit 3f52af0fe6

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { onMount } from 'svelte';
import { onDestroy, onMount } from 'svelte';
import Graph from '../../lib/components/Graph.svelte';
import type IChartFrame from '../../lib/interfaces/IChartFrame';
import type { PageData } from './$types';
@@ -71,6 +71,7 @@
}
onMount(scrollSelectedButtonIntoView);
onDestroy(() => clearTimeout(timeout))
</script>
<div class="button-wrapper">