Skip to content

Fix levelUp event emission logic in addLevel#11

Merged
Abadima merged 2 commits into
LTSfrom
copilot/sub-pr-10
Jan 26, 2026
Merged

Fix levelUp event emission logic in addLevel#11
Abadima merged 2 commits into
LTSfrom
copilot/sub-pr-10

Conversation

Copilot AI commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Information

The levelUp event decision compared the previous level to the increment amount instead of the new level, causing incorrect event emission.

Changed line 46 in src/addLevel.js:

// Before: compares previous level to increment
if (level1 !== level) {

// After: compares previous level to new level
if (level1 !== user.level) {

This ensures levelUp triggers only when the user's level actually changes.

Issue Related

Addresses feedback from PR #10 review comment

Checks

  • Does the package work as intended?

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@codacy-production

codacy-production Bot commented Jan 26, 2026

Copy link
Copy Markdown

Codacy's Analysis Summary

0 new issue (≤ 0 medium issue)
0 new security issue (≤ 0 issue)
0 complexity
0 duplications

Review Pull Request in Codacy →

AI Reviewer available: add the codacy-review label to get contextual insights without leaving GitHub.

Co-authored-by: Abadima <39747270+Abadima@users.noreply.github.com>
@Abadima
Abadima marked this pull request as ready for review January 26, 2026 04:56
Copilot AI changed the title [WIP] Address feedback on 'Merge LTS to Latest' pull request Fix levelUp event emission logic in addLevel Jan 26, 2026
Copilot AI requested a review from Abadima January 26, 2026 04:56
@Abadima
Abadima merged commit 13ac2d9 into LTS Jan 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants