mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-11 03:17:02 +00:00
Handle conversations with no room
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
url: string
|
url: string
|
||||||
room: string
|
room?: string
|
||||||
events: TrustedEvent[]
|
events: TrustedEvent[]
|
||||||
latest: TrustedEvent
|
latest: TrustedEvent
|
||||||
earliest: TrustedEvent
|
earliest: TrustedEvent
|
||||||
@@ -27,8 +27,12 @@
|
|||||||
<ProfileCircle pubkey={earliest.pubkey} size={10} />
|
<ProfileCircle pubkey={earliest.pubkey} size={10} />
|
||||||
<div class="min-w-0 flex-1">
|
<div class="min-w-0 flex-1">
|
||||||
<div class="flex items-center gap-2 text-sm opacity-70">
|
<div class="flex items-center gap-2 text-sm opacity-70">
|
||||||
<span class="font-medium text-blue-400">#{displayChannel(url, room)}</span>
|
{#if room}
|
||||||
<span class="opacity-50">•</span>
|
<span class="font-medium text-blue-400">
|
||||||
|
#{displayChannel(url, room)}
|
||||||
|
</span>
|
||||||
|
<span class="opacity-50">•</span>
|
||||||
|
{/if}
|
||||||
<span>{formatTimestamp(earliest.created_at)}</span>
|
<span>{formatTimestamp(earliest.created_at)}</span>
|
||||||
</div>
|
</div>
|
||||||
<Content minimalQuote minLength={100} maxLength={400} event={earliest} />
|
<Content minimalQuote minLength={100} maxLength={400} event={earliest} />
|
||||||
|
|||||||
@@ -20,8 +20,6 @@
|
|||||||
const convs = []
|
const convs = []
|
||||||
|
|
||||||
for (const [room, messages] of groupBy(e => getTagValue("h", e.tags), $messages).entries()) {
|
for (const [room, messages] of groupBy(e => getTagValue("h", e.tags), $messages).entries()) {
|
||||||
if (!room) continue
|
|
||||||
|
|
||||||
const avgTime = avg(overlappingPairs(messages).map(([a, b]) => a.created_at - b.created_at))
|
const avgTime = avg(overlappingPairs(messages).map(([a, b]) => a.created_at - b.created_at))
|
||||||
const groups: TrustedEvent[][] = []
|
const groups: TrustedEvent[][] = []
|
||||||
const group: TrustedEvent[] = []
|
const group: TrustedEvent[] = []
|
||||||
@@ -79,7 +77,7 @@
|
|||||||
{#if $messages.length > 0}
|
{#if $messages.length > 0}
|
||||||
{@const events = $messages.slice(0, 1)}
|
{@const events = $messages.slice(0, 1)}
|
||||||
{@const event = events[0]}
|
{@const event = events[0]}
|
||||||
{@const room = getTagValue("h", event.tags)!}
|
{@const room = getTagValue("h", event.tags)}
|
||||||
<ConversationCard
|
<ConversationCard
|
||||||
{url}
|
{url}
|
||||||
{room}
|
{room}
|
||||||
|
|||||||
Reference in New Issue
Block a user