Hide loader when no admin posts exist
This commit is contained in:
parent
b6524f4a58
commit
b19881a8a9
2 changed files with 8 additions and 3 deletions
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
export let url
|
export let url
|
||||||
export let pubkey
|
export let pubkey
|
||||||
|
export let events: TrustedEvent[] = []
|
||||||
|
|
||||||
const ctrl = createFeedController({
|
const ctrl = createFeedController({
|
||||||
useWindowing: true,
|
useWindowing: true,
|
||||||
|
|
@ -28,7 +29,6 @@
|
||||||
|
|
||||||
let element: Element
|
let element: Element
|
||||||
let buffer: TrustedEvent[] = []
|
let buffer: TrustedEvent[] = []
|
||||||
let events: TrustedEvent[] = []
|
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
const scroller = createScroller({
|
const scroller = createScroller({
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {page} from "$app/stores"
|
import {page} from "$app/stores"
|
||||||
|
import type {TrustedEvent} from "@welshman/util"
|
||||||
import {deriveRelay} from "@welshman/app"
|
import {deriveRelay} from "@welshman/app"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import Link from "@lib/components/Link.svelte"
|
import Link from "@lib/components/Link.svelte"
|
||||||
|
|
@ -32,6 +33,8 @@
|
||||||
|
|
||||||
const joinSpace = () => pushModal(SpaceJoin, {url})
|
const joinSpace = () => pushModal(SpaceJoin, {url})
|
||||||
|
|
||||||
|
let relayAdminEvents: TrustedEvent[] = []
|
||||||
|
|
||||||
$: pubkey = $relay?.profile?.pubkey
|
$: pubkey = $relay?.profile?.pubkey
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -143,8 +146,10 @@
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{#if pubkey}
|
{#if pubkey}
|
||||||
|
<div class="hidden flex-col gap-2" class:!flex={relayAdminEvents.length > 0}>
|
||||||
<Divider>Recent posts from the relay admin</Divider>
|
<Divider>Recent posts from the relay admin</Divider>
|
||||||
<ProfileFeed {url} {pubkey} />
|
<ProfileFeed {url} {pubkey} bind:events={relayAdminEvents} />
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue