From 5781ae9d82314e433b5fc17a5d6725ce2eaf5c7d Mon Sep 17 00:00:00 2001 From: Emanuel Bennici Date: Tue, 28 Nov 2023 21:23:27 +0100 Subject: [PATCH] feat(web): Lazy load thumbnails on the people page (#5356) * feat(web): Lazy load thumbnails on the people page Instead of loading all people thumbnails at once, only the first few should be loaded eagerly. This reduces the load on client and server side. * chore: change name --------- Co-authored-by: Alex Tran --- .../lib/components/assets/thumbnail/image-thumbnail.svelte | 2 ++ web/src/lib/components/faces-page/people-card.svelte | 2 ++ web/src/routes/(user)/people/+page.svelte | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/web/src/lib/components/assets/thumbnail/image-thumbnail.svelte b/web/src/lib/components/assets/thumbnail/image-thumbnail.svelte index 2527e61d25..a6bdaf257b 100644 --- a/web/src/lib/components/assets/thumbnail/image-thumbnail.svelte +++ b/web/src/lib/components/assets/thumbnail/image-thumbnail.svelte @@ -17,12 +17,14 @@ export let circle = false; export let hidden = false; export let border = false; + export let preload = true; let complete = false; export let eyeColor: 'black' | 'white' = 'white'; 0}
- {#each people as person (person.id)} + {#each people as person, idx (person.id)} {#if !person.isHidden} handleChangeName(person)} on:set-birth-date={() => handleSetBirthDate(person)} on:merge-faces={() => handleMergeFaces(person)} @@ -444,7 +445,7 @@ bind:showLoadingSpinner bind:toggleVisibility > - {#each people as person (person.id)} + {#each people as person, idx (person.id)}