diff --git a/web/src/lib/components/asset-viewer/album-list-item.svelte b/web/src/lib/components/asset-viewer/album-list-item.svelte index 9ab281b740..9c985977b6 100644 --- a/web/src/lib/components/asset-viewer/album-list-item.svelte +++ b/web/src/lib/components/asset-viewer/album-list-item.svelte @@ -29,7 +29,6 @@ {:else} {album.assetCount} items - · {new Date(album.createdAt).toLocaleDateString()} {#if album.shared} · Shared{/if} diff --git a/web/src/lib/components/shared-components/album-selection-modal.svelte b/web/src/lib/components/shared-components/album-selection-modal.svelte index 3d30c9a4f3..2a43812c40 100644 --- a/web/src/lib/components/shared-components/album-selection-modal.svelte +++ b/web/src/lib/components/shared-components/album-selection-modal.svelte @@ -14,12 +14,21 @@ export let shared: boolean; onMount(async () => { + loading = true; + const { data } = await api.albumApi.getAllAlbums(); - albums = data; + + if (shared) { + albums = data.filter((album) => album.shared === shared); + } else { + albums = data; + } + recentAlbums = albums .filter((album) => album.shared === shared) .sort((a, b) => (new Date(a.createdAt) > new Date(b.createdAt) ? -1 : 1)) .slice(0, 3); + loading = false; }); @@ -75,20 +84,16 @@ {#if albums.length > 0} {#if !shared}

RECENT

- {/if} - {#each recentAlbums as album} - {#key album.id} + {#each recentAlbums as album (album.id)} handleSelect(album)} /> - {/key} - {/each} + {/each} + {/if} {#if !shared}

ALL ALBUMS

{/if} - {#each albums as album} - {#key album.id} - handleSelect(album)} /> - {/key} + {#each albums as album (album.id)} + handleSelect(album)} /> {/each} {:else}

It looks like you do not have any albums yet.