WIP PWA for Grain
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: fetch and display avatar data for comments in gallery detail

+23 -6
+4 -1
src/components/organisms/grain-comment-list.js
··· 42 42 43 43 ${this.comments.map(comment => html` 44 44 <grain-comment 45 - handle=${comment.actorHandle} 45 + uri=${comment.uri} 46 + handle=${comment.handle} 47 + displayName=${comment.displayName} 48 + avatarUrl=${comment.avatarUrl} 46 49 text=${comment.text} 47 50 createdAt=${comment.createdAt} 48 51 ></grain-comment>
+19 -5
src/services/grain-api.js
··· 588 588 totalCount 589 589 edges { 590 590 node { 591 + uri 591 592 text 592 593 createdAt 593 594 actorHandle 595 + replyTo 596 + socialGrainActorProfileByDid { 597 + displayName 598 + avatar { url(preset: "avatar") } 599 + } 594 600 } 595 601 } 596 602 } ··· 631 637 const galleryItemUris = galleryItems.map(item => item.uri).filter(Boolean); 632 638 const photoUris = photos.map(p => p.uri).filter(Boolean); 633 639 634 - const comments = galleryNode.socialGrainCommentViaSubject?.edges?.map(edge => ({ 635 - text: edge.node.text, 636 - createdAt: edge.node.createdAt, 637 - actorHandle: edge.node.actorHandle 638 - })) || []; 640 + const comments = galleryNode.socialGrainCommentViaSubject?.edges?.map(edge => { 641 + const node = edge.node; 642 + const commentProfile = node.socialGrainActorProfileByDid; 643 + return { 644 + uri: node.uri, 645 + text: node.text, 646 + createdAt: node.createdAt, 647 + handle: node.actorHandle, 648 + displayName: commentProfile?.displayName || '', 649 + avatarUrl: commentProfile?.avatar?.url || '', 650 + replyToUri: node.replyTo || null 651 + }; 652 + }) || []; 639 653 640 654 return { 641 655 uri: galleryNode.uri,