{m.notification_bell_label()} {#if notifications.length > 0}
{ errorMessage = null; optimisticMarkAllRead(); return async ({ result, update }) => { if (result.type === 'failure' || result.type === 'error') { errorMessage = (result as { data?: { error?: string } }).data?.error ?? m.notification_error_generic(); await update({ reset: false, invalidateAll: false }); } }; }} >
{/if}
{#if errorMessage}

{errorMessage}

{/if} {#if notifications.length === 0}
{m.notification_empty()}
{:else}
    {#each notifications as notification (notification.id)}
  • { errorMessage = null; optimisticMarkRead(notification.id); return async ({ result, update }) => { if (result.type === 'failure' || result.type === 'error') { errorMessage = (result as { data?: { error?: string } }).data?.error ?? m.notification_error_generic(); await update({ reset: false, invalidateAll: false }); } else { // Navigate away — no need to update the store since we're leaving the page onClose(); goto( buildCommentHref( notification.documentId, notification.referenceId, notification.annotationId ) ); } }; }} >
  • {/each}
{/if}