From 834e176841460cab51c8d856c2aac3b7bcb0120b Mon Sep 17 00:00:00 2001 From: June Date: Tue, 18 Nov 2025 13:21:41 +1300 Subject: [PATCH] trying and half-failing to get image preloading to work lol --- web/src/components/photos/carousel.astro | 24 ++++++++++++++++++++---- web/src/pages/photos/index.astro | 4 ---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/web/src/components/photos/carousel.astro b/web/src/components/photos/carousel.astro index a0ab12c..863c8be 100644 --- a/web/src/components/photos/carousel.astro +++ b/web/src/components/photos/carousel.astro @@ -1,6 +1,5 @@ --- import { authPB } from "src/utils/pocketbase"; -import type { RecordModel } from 'pocketbase' // export const prerender = false @@ -8,6 +7,10 @@ const pb = await authPB() const photos = await pb.collection('photos').getFullList({ sort: '-created' }) + +const photoLinks = await Promise.all( + photos.map(p => pb.files.getURL(p, p.image)) +) ---