1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

perf(web): optimize response sizes for initial page load (#7594)

This commit is contained in:
Mert 2024-03-06 12:05:53 -05:00 committed by GitHub
parent ba12d92af3
commit f88343019d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 13 deletions

View file

@ -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 @@
<Portal target="body">
{#if $showAssetViewer}
<AssetViewer
{withStacked}
{assetStore}
asset={$viewingAsset}
{isShared}
{album}
on:previous={handlePrevious}
on:next={handleNext}
on:close={handleClose}
on:action={({ detail: action }) => handleAction(action.type, action.asset)}
/>
{#await import('../asset-viewer/asset-viewer.svelte') then AssetViewer}
<AssetViewer.default
{withStacked}
{assetStore}
asset={$viewingAsset}
{isShared}
{album}
on:previous={handlePrevious}
on:next={handleNext}
on:close={handleClose}
on:action={({ detail: action }) => handleAction(action.type, action.asset)}
/>
{/await}
{/if}
</Portal>

View file

@ -73,7 +73,7 @@
>
<img
class="h-full w-full rounded-xl object-cover"
src={getAssetThumbnailUrl(memory.assets[0].id, ThumbnailFormat.Jpeg)}
src={getAssetThumbnailUrl(memory.assets[0].id, ThumbnailFormat.Webp)}
alt={`Memory Lane ${getAltText(memory.assets[0])}`}
draggable="false"
/>