This commit is contained in:
2023-09-19 13:04:19 +01:00
parent dde730238d
commit f5617d1b01
8 changed files with 43 additions and 40 deletions

View File

@ -154,7 +154,8 @@ const TierThree = ({ active, isLastSubthread, notes, related, chains, onNavigate
return ( return (
<> <>
<div <div
className={`subthread-container ${hasMultipleNotes ? "subthread-multi" : ""} ${isLast ? "subthread-last" : "subthread-mid" className={`subthread-container ${hasMultipleNotes ? "subthread-multi" : ""} ${
isLast ? "subthread-last" : "subthread-mid"
}`}> }`}>
<Divider variant="small" /> <Divider variant="small" />
<Note <Note
@ -184,7 +185,8 @@ const TierThree = ({ active, isLastSubthread, notes, related, chains, onNavigate
return ( return (
<div <div
key={r.id} key={r.id}
className={`subthread-container ${lastReply ? "" : "subthread-multi"} ${lastReply ? "subthread-last" : "subthread-mid" className={`subthread-container ${lastReply ? "" : "subthread-multi"} ${
lastReply ? "subthread-last" : "subthread-mid"
}`}> }`}>
<Divider variant="small" /> <Divider variant="small" />
<Note <Note

View File

@ -12,11 +12,7 @@ export default function useThreadFeed(link: NostrLink) {
sub.withOptions({ sub.withOptions({
leaveOpen: true, leaveOpen: true,
}); });
sub sub.withFilter().kinds([EventKind.TextNote]).link(link).replyToLink(link);
.withFilter()
.kinds([EventKind.TextNote])
.link(link)
.replyToLink(link);
allEvents.forEach(x => { allEvents.forEach(x => {
sub.withFilter().kinds([EventKind.TextNote]).link(x).replyToLink(x); sub.withFilter().kinds([EventKind.TextNote]).link(x).replyToLink(x);
}); });

View File

@ -296,11 +296,14 @@ export class NostrSystem extends ExternalStore<SystemSnapshot> implements System
if (cacheResults.length > 0) { if (cacheResults.length > 0) {
const resultIds = new Set(cacheResults.map(a => a.id)); const resultIds = new Set(cacheResults.map(a => a.id));
f.ids = f.ids.filter(a => !resultIds.has(a)); f.ids = f.ids.filter(a => !resultIds.has(a));
q.insertCompletedTrace({ q.insertCompletedTrace(
{
filters: [{ ...f, ids: [...resultIds] }], filters: [{ ...f, ids: [...resultIds] }],
strategy: RequestStrategy.ExplicitRelays, strategy: RequestStrategy.ExplicitRelays,
relay: "" relay: "",
}, cacheResults as Array<TaggedNostrEvent>); },
cacheResults as Array<TaggedNostrEvent>,
);
} }
} }
} }

View File

@ -39,7 +39,7 @@ export class ProfileLoaderService {
TrackMetadata(pk: HexKey | Array<HexKey>) { TrackMetadata(pk: HexKey | Array<HexKey>) {
for (const p of Array.isArray(pk) ? pk : [pk]) { for (const p of Array.isArray(pk) ? pk : [pk]) {
if (p.length === 64) { if (p.length === 64) {
this.#wantsMetadata.add(p) this.#wantsMetadata.add(p);
} }
} }
} }

View File

@ -146,7 +146,9 @@ export class RequestBuilder {
const filtersSquashed = [...relayMerged.values()].map(a => { const filtersSquashed = [...relayMerged.values()].map(a => {
return { return {
filters: system.QueryOptimizer.flatMerge(a.flatMap(b => b.filters.flatMap(c => system.QueryOptimizer.expandFilter(c)))), filters: system.QueryOptimizer.flatMerge(
a.flatMap(b => b.filters.flatMap(c => system.QueryOptimizer.expandFilter(c))),
),
relay: a[0].relay, relay: a[0].relay,
strategy: a[0].strategy, strategy: a[0].strategy,
} as BuiltRawReqFilter; } as BuiltRawReqFilter;