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,14 +597,16 @@
{#snippet trailing()} {#snippet trailing()}
<CastButton /> <CastButton />
<IconButton {#if containsEditors}
variant="ghost" <IconButton
shape="round" variant="ghost"
color="secondary" shape="round"
aria-label="view asset owners" color="secondary"
icon={mdiAccountEyeOutline} aria-label="view asset owners"
onclick={() => (showAlbumUsers = !showAlbumUsers)} icon={mdiAccountEyeOutline}
/> onclick={() => (showAlbumUsers = !showAlbumUsers)}
/>
{/if}
{#if isEditor} {#if isEditor}
<IconButton <IconButton