Skip to content
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

Package Detail page versions tab #1279

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

Oksamies
Copy link
Contributor

@Oksamies Oksamies commented Jan 3, 2025

No description provided.

Copy link
Contributor Author

Oksamies commented Jan 3, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Oksamies Oksamies force-pushed the 01-03-package_detail_page_versions_tab branch from 981a958 to bc0f143 Compare January 3, 2025 21:55
Comment on lines +102 to +115
function compare(a: TableRow, b: TableRow) {
const column = sortVariables.identifier;
if (a[column] && b[column] && a[column].sortValue < b[column].sortValue) {
return sortVariables.direction;
}
if (a[column] && b[column] && a[column].sortValue > b[column].sortValue) {
return -sortVariables.direction;
}
return 0;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compare() function's logic appears reversed. Currently sortVariables.direction is returned when a < b and -sortVariables.direction when a > b, which will produce the opposite of the intended sort order. To fix this, swap the return values - return -sortVariables.direction for a < b and sortVariables.direction for a > b.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Base automatically changed from 12-30-packagedetails_required_tab to master January 7, 2025 17:21
@Oksamies Oksamies force-pushed the 01-03-package_detail_page_versions_tab branch from bc0f143 to fa8cc82 Compare January 7, 2025 19:30
@Oksamies Oksamies force-pushed the 01-03-package_detail_page_versions_tab branch from fa8cc82 to 216ea18 Compare January 8, 2025 11:21
@Oksamies Oksamies merged commit 45a59d3 into master Jan 8, 2025
25 checks passed
@Oksamies Oksamies deleted the 01-03-package_detail_page_versions_tab branch January 8, 2025 11:30
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.

1 participant