Skip to content

Commit dcc5d3c

Browse files
committed
Fix the mount logic for PR comment reactions
1 parent 34e0407 commit dcc5d3c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lazy_github/ui/widgets/conversations.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,11 @@ def action_reply_to_individual_comment(self) -> None:
123123
self.reply_to_comment_flow()
124124

125125
async def add_reaction_display(self, reactions: ReactionSet) -> None:
126-
# Add the reactions to the bottom of each comment display
127126
if not reactions:
128127
return
129128

130129
rd = ReactionsDisplay(self.comment.id)
131-
await self.children[-1].mount(rd)
130+
await self.mount(rd, after=len(self.children) - 1)
132131
await rd.set_reactions(reactions)
133132

134133

lazy_github/ui/widgets/pull_requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ async def handle_reviews_loaded(self, message: ReviewsAndCommentsLoaded) -> None
456456

457457
@on(CommentReactionsLoaded)
458458
async def handle_comment_reactions_loaded(self, message: CommentReactionsLoaded) -> None:
459+
"""Adds any reactions on comments to the comment widgets that they're associated with"""
459460
tasks: list[Coroutine[Any, Any, None]] = []
460461
for comment_id, reactions in message.reactions.items():
461462
if comment := self.comment_containers.get(str(comment_id)):

0 commit comments

Comments
 (0)