Hide loader when no admin posts exist

This commit is contained in:
Jon Staab
2024-12-11 13:35:06 -08:00
parent b6524f4a58
commit b19881a8a9
2 changed files with 8 additions and 3 deletions

View File

@@ -12,6 +12,7 @@
export let url
export let pubkey
export let events: TrustedEvent[] = []
const ctrl = createFeedController({
useWindowing: true,
@@ -28,7 +29,6 @@
let element: Element
let buffer: TrustedEvent[] = []
let events: TrustedEvent[] = []
onMount(() => {
const scroller = createScroller({

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import {page} from "$app/stores"
import type {TrustedEvent} from "@welshman/util"
import {deriveRelay} from "@welshman/app"
import Icon from "@lib/components/Icon.svelte"
import Link from "@lib/components/Link.svelte"
@@ -32,6 +33,8 @@
const joinSpace = () => pushModal(SpaceJoin, {url})
let relayAdminEvents: TrustedEvent[] = []
$: pubkey = $relay?.profile?.pubkey
</script>
@@ -143,8 +146,10 @@
{/each}
</div>
{#if pubkey}
<Divider>Recent posts from the relay admin</Divider>
<ProfileFeed {url} {pubkey} />
<div class="hidden flex-col gap-2" class:!flex={relayAdminEvents.length > 0}>
<Divider>Recent posts from the relay admin</Divider>
<ProfileFeed {url} {pubkey} bind:events={relayAdminEvents} />
</div>
{/if}
</div>
</div>