From 9b72f0c5614cf1e30dcf2baded73c45100fdefdc Mon Sep 17 00:00:00 2001 From: nwrenger Date: Sun, 10 Mar 2024 21:31:02 +0100 Subject: [PATCH] :wrench: Minor refactor --- lib-view/src/routes/+layout.svelte | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib-view/src/routes/+layout.svelte b/lib-view/src/routes/+layout.svelte index cf6e746..d484b99 100644 --- a/lib-view/src/routes/+layout.svelte +++ b/lib-view/src/routes/+layout.svelte @@ -75,15 +75,11 @@ category.set(categories); } - async function updatePeriodically() { - await update(); - } - onMount(() => { // Run the `update` function immediately on mount - updatePeriodically(); + update(); - const interval = setInterval(updatePeriodically, 300000); + const interval = setInterval(update, 300000); // Cleanup the interval when the component is unmounted return () => {