mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-10 19:07:06 +00:00
Listen for new threads and replies
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
style={expandBlock ? "mask-image: linear-gradient(0deg, transparent 0px, black 100px)" : ""}>
|
||||
{#each shortContent as parsed, i}
|
||||
{#if isNewline(parsed)}
|
||||
<ContentNewline value={parsed.value.slice(1) || "\n"} />
|
||||
<ContentNewline value={parsed.value} />
|
||||
{:else if isTopic(parsed)}
|
||||
<ContentTopic value={parsed.value} />
|
||||
{:else if isCode(parsed)}
|
||||
|
||||
@@ -44,10 +44,7 @@
|
||||
</PrimaryNavItem>
|
||||
{/each}
|
||||
<PrimaryNavItem title="Add Space" on:click={addSpace} class="tooltip-right">
|
||||
<Avatar icon="add-circle" class="!h-10 !w-10" />
|
||||
</PrimaryNavItem>
|
||||
<PrimaryNavItem title="Discover Spaces" href="/discover" class="tooltip-right">
|
||||
<Avatar icon="compass-big" class="!h-10 !w-10" />
|
||||
<Avatar icon="settings-minimalistic" class="!h-10 !w-10" />
|
||||
</PrimaryNavItem>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {page} from "$app/stores"
|
||||
import {now, assoc} from "@welshman/lib"
|
||||
import {getListTags, getPubkeyTagValues} from "@welshman/util"
|
||||
import type {Filter} from "@welshman/util"
|
||||
import {feedsFromFilters, makeIntersectionFeed, makeRelayFeed} from "@welshman/feeds"
|
||||
@@ -16,6 +17,7 @@
|
||||
import ThreadCreate from "@app/components/ThreadCreate.svelte"
|
||||
import {THREAD, COMMENT, deriveEventsForUrl, decodeRelay} from "@app/state"
|
||||
import {pushModal, pushDrawer} from "@app/modal"
|
||||
import {subscribePersistent} from "@app/commands"
|
||||
|
||||
const url = decodeRelay($page.params.relay)
|
||||
const events = deriveEventsForUrl(url, [{kinds: [THREAD]}])
|
||||
@@ -37,8 +39,11 @@
|
||||
let element: Element
|
||||
|
||||
onMount(() => {
|
||||
// Why is element not defined sometimes? SVELTEKIT
|
||||
if (element) {
|
||||
const unsub = subscribePersistent({
|
||||
filters: filters.map(assoc('since', now())),
|
||||
relays: [url],
|
||||
})
|
||||
|
||||
const scroller = createScroller({
|
||||
element,
|
||||
delay: 300,
|
||||
@@ -51,7 +56,9 @@
|
||||
},
|
||||
})
|
||||
|
||||
return () => scroller.stop()
|
||||
return () => {
|
||||
unsub()
|
||||
scroller.stop()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user