-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: displaying reactions issue #1596
Conversation
WalkthroughThe changes in this pull request involve modifications to the Changes
Possibly related PRs
Suggested labels
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/extension-polkagate/src/fullscreen/governance/utils/helpers.ts (1)
466-466
: LGTM! Consider a minor optimization for reaction aggregation.The changes improve the accuracy of reaction data by aggregating addresses of all users who reacted. This enhancement applies to both main comments and replies, ensuring consistency in reaction representation.
Consider using the
filter
method to exclude null values and simplify the code:-'👍': { count: reactions.length, usernames: reactions.map((reaction) => reaction.user?.address ?? '') ?? null }, +'👍': { count: reactions.length, usernames: reactions.map((reaction) => reaction.user?.address).filter(Boolean) },This change would eliminate empty strings from the
usernames
array, potentially improving data quality.Also applies to: 481-481
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/extension-polkagate/src/fullscreen/governance/utils/helpers.ts (3 hunks)
🧰 Additional context used
🔇 Additional comments (2)
packages/extension-polkagate/src/fullscreen/governance/utils/helpers.ts (2)
Line range hint
1-502
: Overall assessment: Changes improve data structure and accuracy.The modifications to the
ReactionSS
interface andgetReferendumCommentsSS
function enhance the structure of user data and improve the accuracy of reaction aggregation. These changes align well with the PR objectives of fixing the displaying reaction issue.To ensure a smooth integration of these changes:
- Verify that all usages of the
ReactionSS
interface have been updated accordingly.- Consider the suggested optimization for reaction aggregation to further improve data quality.
- Conduct thorough testing to confirm that the changes resolve the displaying reaction issue as intended.
103-107
: LGTM! Verify usage of the updatedReactionSS
interface.The
ReactionSS
interface has been improved to provide more structured user data. This change enhances type safety and provides more detailed information about the user associated with a reaction.Please ensure that all usages of the
ReactionSS
interface have been updated to accommodate this change. Run the following script to verify:
## [0.19.2](v0.19.1...v0.19.2) (2024-10-22) ### Bug Fixes * fix displaying reaction issue ([#1596](#1596)) ([1a0e8a9](1a0e8a9))
Close: #1595
Summary by CodeRabbit
New Features
Bug Fixes