홈, 갤러리, 캐시 설정, 썸네일 설정 페이지에서의 네트워크 호출 최적화

This commit is contained in:
static committed 2026-01-01 23:31:01 +09:00
1 parent 841c57e8fc
commit d98be331ad
10 files changed
+267 -36

No files matched your search

+2 -4
View File
@@ -4,7 +4,7 @@
import { FullscreenDiv } from "$lib/components/atoms";
import { TopBar } from "$lib/components/molecules";
import { Gallery } from "$lib/components/organisms";
import { getFileInfo, type MaybeFileInfo } from "$lib/modules/filesystem";
import { bulkGetFileInfo, type MaybeFileInfo } from "$lib/modules/filesystem";
import { masterKeyStore } from "$lib/stores";
let { data } = $props();
@@ -12,9 +12,7 @@
let files: MaybeFileInfo[] = $state([]);
onMount(async () => {
files = await Promise.all(
data.files.map((file) => getFileInfo(file, $masterKeyStore?.get(1)?.key!)),
);
files = Array.from((await bulkGetFileInfo(data.files, $masterKeyStore?.get(1)?.key!)).values());
});
</script>