- {#if actions.length > 0}
+ {#if enabledActions.length > 0}
- {#each actions as action, i (i)}
- {#if !isMenuItemType(action) && (action.$if?.() ?? true)}
-
- {/if}
+ {#each enabledActions as action, i (i)}
+
{/each}
diff --git a/web/src/lib/components/layouts/user-page-layout.svelte b/web/src/lib/components/layouts/user-page-layout.svelte
index 34c1aef4fc..af85f5f37f 100644
--- a/web/src/lib/components/layouts/user-page-layout.svelte
+++ b/web/src/lib/components/layouts/user-page-layout.svelte
@@ -40,6 +40,12 @@
children,
}: Props = $props();
+ const enabledActions = $derived(
+ actions
+ .filter((action): action is HeaderButtonActionItem => !isMenuItemType(action))
+ .filter((action) => action.$if?.() ?? true),
+ );
+
let scrollbarClass = $derived(scrollbar ? 'immich-scrollbar' : 'scrollbar-hidden');
let hasTitleClass = $derived(title ? 'top-16 h-[calc(100%-(--spacing(16)))]' : 'top-0 h-full');
@@ -82,22 +88,20 @@
{@render buttons?.()}
- {#if actions.length > 0}
+ {#if enabledActions.length > 0}
- {#each actions as action, i (i)}
- {#if !isMenuItemType(action) && (action.$if?.() ?? true)}
-
- {/if}
+ {#each enabledActions as action, i (i)}
+
{/each}