-
Notifications
You must be signed in to change notification settings - Fork 975
Conversation
64ea8cd
to
f34e416
Compare
@@ -272,6 +272,30 @@ class LedgerTable extends ImmutableComponent { | |||
] | |||
} | |||
|
|||
sortCheck (prevRows, currentRows) { |
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.
Do you think you could add some tests or perhaps a comment block explaining the logic inside the inner loop? (Perhaps what values of each row are being compared to determine the sort check and why?) It is understandable why the old JSON.stringify
comparison of each row may not have been efficient but it was more readable :)
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.
comment added
if (this.dimensionCount == null && prevProps.rows) { | ||
for (let i = 0; i < prevProps.rows.length; i++) { | ||
if (this.props.rows[i].length > 0) { | ||
if (this.props.rows[i]) { |
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.
Is this inner if
necessary? the upper check for this.props.rows[i].length > 0
wouldn't pass for falsy objects.
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.
good catch, not needed
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.
Test plan works well, no CPU spike, I left a couple of comments
Resolves brave#13721 Auditors: Test Plan:
f34e416
to
a7bdaac
Compare
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.
Great fix! Thanks for the changes
If you're looking at the list with a bunch of items, a re-sort is done after you delete an item. Unfortunately, this order seems to be different every time. If you want to delete three items in a row for example, you can't... because it's shuffled after deleting one (because they both have 0 percent) |
Perhaps the issue I mentioned above can be added to the scope of #14111 |
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.
Changes work great!
Fixes sortTable default sort
Fixes sortTable default sort
Resolves #13721
This PR is basically the same as #13726, I just needed to adjust
sortCheck
inledgerTable
component.Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests