Don't show 'view owners' button if the album doesn't have editors

This commit is contained in:
CJPeckover
2025-11-23 21:49:47 -05:00
parent c0afde91a7
commit f353c99223
@@ -291,10 +291,10 @@
let album = $derived(data.album); let album = $derived(data.album);
let albumId = $derived(album.id); let albumId = $derived(album.id);
const containsEditors = $derived(album?.shared && album.albumUsers.some(({ role }) => role === AlbumUserRole.Editor));
const albumUsers = $derived( const albumUsers = $derived(
showAlbumUsers && album?.shared && album.albumUsers.some(({ role }) => role === AlbumUserRole.Editor) showAlbumUsers && containsEditors ? [album.owner, ...album.albumUsers.map(({ user }) => user)] : [],
? [album.owner, ...album.albumUsers.map(({ user }) => user)]
: [],
); );
$effect(() => { $effect(() => {
@@ -597,6 +597,7 @@
{#snippet trailing()} {#snippet trailing()}
<CastButton /> <CastButton />
{#if containsEditors}
<IconButton <IconButton
variant="ghost" variant="ghost"
shape="round" shape="round"
@@ -605,6 +606,7 @@
icon={mdiAccountEyeOutline} icon={mdiAccountEyeOutline}
onclick={() => (showAlbumUsers = !showAlbumUsers)} onclick={() => (showAlbumUsers = !showAlbumUsers)}
/> />
{/if}
{#if isEditor} {#if isEditor}
<IconButton <IconButton