forked from coracle/flotilla
Bump welshman
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
editor = getEditor({autofocus: !isMobile, element, submit, uploading})
|
||||
editor = getEditor({autofocus: !isMobile, element, submit, uploading, aggressive: true})
|
||||
|
||||
$editor!.chain().setContent(content).run()
|
||||
})
|
||||
|
||||
@@ -34,7 +34,10 @@
|
||||
<div class="flex flex-col justify-start gap-1">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<div class="flex min-w-0 items-center gap-2">
|
||||
{#if others.length === 1}
|
||||
{#if others.length === 0}
|
||||
<ProfileCircle pubkey={$pubkey} size={5} />
|
||||
Note to self
|
||||
{:else if others.length === 1}
|
||||
<ProfileCircle pubkey={others[0]} size={5} />
|
||||
<ProfileName pubkey={others[0]} />
|
||||
{:else}
|
||||
|
||||
@@ -112,7 +112,8 @@
|
||||
</div>
|
||||
</Button>
|
||||
{/if}
|
||||
<span class="text-xs opacity-50">{formatTimestampAsTime(event.created_at)}</span>
|
||||
<span class="whitespace-nowrap text-xs opacity-50"
|
||||
>{formatTimestampAsTime(event.created_at)}</span>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="text-sm">
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {first, sortBy, ctx} from "@welshman/lib"
|
||||
import {getAncestorTags} from "@welshman/util"
|
||||
import {ctx} from "@welshman/lib"
|
||||
import type {Filter} from "@welshman/util"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {repository, load, loadRelaySelections, formatTimestampRelative} from "@welshman/app"
|
||||
@@ -13,11 +12,9 @@
|
||||
|
||||
export let pubkey
|
||||
|
||||
const filters: Filter[] = [{authors: [pubkey]}]
|
||||
const filters: Filter[] = [{authors: [pubkey], limit: 1}]
|
||||
const events = deriveEvents(repository, {filters})
|
||||
|
||||
$: roots = $events.filter(e => getAncestorTags(e.tags).replies.length === 0)
|
||||
|
||||
onMount(async () => {
|
||||
// Make sure we have their relay selections before we load their posts
|
||||
await loadRelaySelections(pubkey)
|
||||
@@ -39,10 +36,9 @@
|
||||
</Link>
|
||||
</div>
|
||||
<ProfileInfo {pubkey} />
|
||||
{#if roots.length > 0}
|
||||
{@const event = first(sortBy(e => -e.created_at, roots))}
|
||||
{#if $events.length > 0}
|
||||
<div class="bg-alt badge badge-neutral border-none">
|
||||
Last active {formatTimestampRelative(event.created_at)}
|
||||
Last active {formatTimestampRelative($events[0].created_at)}
|
||||
</div>
|
||||
{/if}
|
||||
<Link class="btn btn-primary sm:hidden" href={makeChatPath([pubkey])}>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import {onMount} from "svelte"
|
||||
import {sortBy, uniqBy} from "@welshman/lib"
|
||||
import {feedFromFilter, makeIntersectionFeed, makeRelayFeed} from "@welshman/feeds"
|
||||
import {NOTE, getAncestorTags} from "@welshman/util"
|
||||
import {NOTE, getReplyTags} from "@welshman/util"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {createFeedController} from "@welshman/app"
|
||||
import {createScroller} from "@lib/html"
|
||||
@@ -22,7 +22,7 @@
|
||||
feedFromFilter({kinds: [NOTE], authors: [pubkey]}),
|
||||
),
|
||||
onEvent: (event: TrustedEvent) => {
|
||||
if (getAncestorTags(event.tags).replies.length === 0) {
|
||||
if (getReplyTags(event.tags).replies.length === 0) {
|
||||
buffer.push(event)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -36,16 +36,18 @@
|
||||
)
|
||||
|
||||
onMount(() => {
|
||||
load({
|
||||
relays: [url],
|
||||
filters: [{kinds: [REACTION, REPORT, DELETE], "#e": [event.id]}],
|
||||
onEvent: batch(300, (events: TrustedEvent[]) => {
|
||||
load({
|
||||
relays: [url],
|
||||
filters: [{kinds: [DELETE], "#e": events.map(e => e.id)}],
|
||||
})
|
||||
}),
|
||||
})
|
||||
if (url) {
|
||||
load({
|
||||
relays: [url],
|
||||
filters: [{kinds: [REACTION, REPORT, DELETE], "#e": [event.id]}],
|
||||
onEvent: batch(300, (events: TrustedEvent[]) => {
|
||||
load({
|
||||
relays: [url],
|
||||
filters: [{kinds: [DELETE], "#e": events.map(e => e.id)}],
|
||||
})
|
||||
}),
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user