mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
Don't show 'view owners' button if the album doesn't have editors
This commit is contained in:
+13
-11
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user