+8
-7
src/lib/state.svelte.ts
+8
-7
src/lib/state.svelte.ts
···
278
278
allPosts.set(parsedUri.repo, posts);
279
279
}
280
280
posts.set(post.uri, post);
281
-
const link: Backlink = {
282
-
did: parsedUri.repo,
283
-
collection: parsedUri.collection,
284
-
rkey: parsedUri.rkey
285
-
};
286
281
if (post.record.reply) {
287
-
addBacklinks(post.record.reply.parent.uri, replySource, [link]);
282
+
addBacklinks(post.record.reply.parent.uri, replySource, [
283
+
{
284
+
did: parsedUri.repo,
285
+
collection: parsedUri.collection,
286
+
rkey: parsedUri.rkey
287
+
}
288
+
]);
288
289
289
290
// update reply index
290
291
const parentDid = extractDidFromUri(post.record.reply.parent.uri);
···
322
323
const post = allPosts.get(did)?.get(uri);
323
324
// we need to traverse the post chain to add all posts in the chain to the timeline
324
325
// because the parent posts might not be in the timeline yet
325
-
const chain = post ? traversePostChain(post) : [];
326
+
const chain = post ? traversePostChain(post) : [uri];
326
327
for (const uri of chain) timeline.add(uri);
327
328
}
328
329
};