mirror of
https://github.com/immich-app/immich.git
synced 2024-11-16 10:28:54 -07:00
fix(web) Fix incorrect album type (shared/non-shared) in album selection modal (#1219)
* fix(web) Fix incorrect album type (shared/non-shared) in album selection modal * styling * remove deadcode
This commit is contained in:
parent
93274a6d7b
commit
6736063f83
@ -29,7 +29,6 @@
|
|||||||
</span>
|
</span>
|
||||||
{:else}
|
{:else}
|
||||||
<span>{album.assetCount} items</span>
|
<span>{album.assetCount} items</span>
|
||||||
<span> · {new Date(album.createdAt).toLocaleDateString()}</span>
|
|
||||||
<span
|
<span
|
||||||
>{#if album.shared} · Shared{/if}
|
>{#if album.shared} · Shared{/if}
|
||||||
</span>
|
</span>
|
||||||
|
@ -14,12 +14,21 @@
|
|||||||
export let shared: boolean;
|
export let shared: boolean;
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
loading = true;
|
||||||
|
|
||||||
const { data } = await api.albumApi.getAllAlbums();
|
const { data } = await api.albumApi.getAllAlbums();
|
||||||
albums = data;
|
|
||||||
|
if (shared) {
|
||||||
|
albums = data.filter((album) => album.shared === shared);
|
||||||
|
} else {
|
||||||
|
albums = data;
|
||||||
|
}
|
||||||
|
|
||||||
recentAlbums = albums
|
recentAlbums = albums
|
||||||
.filter((album) => album.shared === shared)
|
.filter((album) => album.shared === shared)
|
||||||
.sort((a, b) => (new Date(a.createdAt) > new Date(b.createdAt) ? -1 : 1))
|
.sort((a, b) => (new Date(a.createdAt) > new Date(b.createdAt) ? -1 : 1))
|
||||||
.slice(0, 3);
|
.slice(0, 3);
|
||||||
|
|
||||||
loading = false;
|
loading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -75,20 +84,16 @@
|
|||||||
{#if albums.length > 0}
|
{#if albums.length > 0}
|
||||||
{#if !shared}
|
{#if !shared}
|
||||||
<p class="text-xs px-5 py-3">RECENT</p>
|
<p class="text-xs px-5 py-3">RECENT</p>
|
||||||
{/if}
|
{#each recentAlbums as album (album.id)}
|
||||||
{#each recentAlbums as album}
|
|
||||||
{#key album.id}
|
|
||||||
<AlbumListItem variant="simple" {album} on:album={() => handleSelect(album)} />
|
<AlbumListItem variant="simple" {album} on:album={() => handleSelect(album)} />
|
||||||
{/key}
|
{/each}
|
||||||
{/each}
|
{/if}
|
||||||
|
|
||||||
{#if !shared}
|
{#if !shared}
|
||||||
<p class="text-xs px-5 py-3">ALL ALBUMS</p>
|
<p class="text-xs px-5 py-3">ALL ALBUMS</p>
|
||||||
{/if}
|
{/if}
|
||||||
{#each albums as album}
|
{#each albums as album (album.id)}
|
||||||
{#key album.id}
|
<AlbumListItem {album} on:album={() => handleSelect(album)} />
|
||||||
<AlbumListItem {album} on:album={() => handleSelect(album)} />
|
|
||||||
{/key}
|
|
||||||
{/each}
|
{/each}
|
||||||
{:else}
|
{:else}
|
||||||
<p class="text-sm px-5 py-1">It looks like you do not have any albums yet.</p>
|
<p class="text-sm px-5 py-1">It looks like you do not have any albums yet.</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user