From f88343019dc397f8068542f5ccf4599004944901 Mon Sep 17 00:00:00 2001
From: Mert <101130780+mertalev@users.noreply.github.com>
Date: Wed, 6 Mar 2024 12:05:53 -0500
Subject: [PATCH] perf(web): optimize response sizes for initial page load
(#7594)
---
.../components/photos-page/asset-grid.svelte | 25 ++++++++++---------
.../components/photos-page/memory-lane.svelte | 2 +-
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/web/src/lib/components/photos-page/asset-grid.svelte b/web/src/lib/components/photos-page/asset-grid.svelte
index 10226a5ae4..2dd35ca30f 100644
--- a/web/src/lib/components/photos-page/asset-grid.svelte
+++ b/web/src/lib/components/photos-page/asset-grid.svelte
@@ -14,7 +14,6 @@
import type { AlbumResponseDto, AssetResponseDto } from '@immich/sdk';
import { DateTime } from 'luxon';
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
- import AssetViewer from '../asset-viewer/asset-viewer.svelte';
import IntersectionObserver from '../asset-viewer/intersection-observer.svelte';
import Portal from '../shared-components/portal/portal.svelte';
import Scrollbar from '../shared-components/scrollbar/scrollbar.svelte';
@@ -451,17 +450,19 @@
{#if $showAssetViewer}
- handleAction(action.type, action.asset)}
- />
+ {#await import('../asset-viewer/asset-viewer.svelte') then AssetViewer}
+ handleAction(action.type, action.asset)}
+ />
+ {/await}
{/if}
diff --git a/web/src/lib/components/photos-page/memory-lane.svelte b/web/src/lib/components/photos-page/memory-lane.svelte
index 51c1e4fc67..6faa41362f 100644
--- a/web/src/lib/components/photos-page/memory-lane.svelte
+++ b/web/src/lib/components/photos-page/memory-lane.svelte
@@ -73,7 +73,7 @@
>