Przeglądaj źródła

feat: do not initiate requests when the ChangelogModal is not open

Shirasawa 3 tygodni temu
rodzic
commit
7735a04783
1 zmienionych plików z 5 dodań i 4 usunięć
  1. 5 4
      src/lib/components/ChangelogModal.svelte

+ 5 - 4
src/lib/components/ChangelogModal.svelte

@@ -19,10 +19,11 @@
 
 	let changelog = null;
 
-	onMount(async () => {
-		const res = await getChangelog();
-		changelog = res;
-	});
+	const init = async () => {
+		changelog = await getChangelog();
+	};
+
+	$: show && init();
 </script>
 
 <Modal bind:show size="xl">