Browse Source

Merge pull request #17542 from ShirasawaSama/patch-23

feat: do not initiate requests when the ChangelogModal is not open to speed up page loading
Tim Jaeryang Baek 3 weeks ago
parent
commit
0159a33306
1 changed files with 5 additions and 4 deletions
  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">