-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 the new message button doesn't work on some comment linkings #46627
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
00a7bed
Fix the new message button doesn't work for some comment linkings
tsa321 69ce490
Merge branch 'main' into fixNwMessageBtnCmntLnkng
tsa321 4987917
Fix pagination util prev page
tsa321 76f9489
Using one source of route for report screen, view and list
tsa321 7036096
using one source of route in report screen, view and list and fixees …
tsa321 4b4b369
Merge branch 'main' into fixNwMessageBtnCmntLnkng
tsa321 3235453
revert index of linked action search
tsa321 ceae85f
Fix typechek error
tsa321 a9d1374
Fix perf-test error
tsa321 02fca25
Change method to get last item of result
tsa321 da00fa5
Fix lint
tsa321 19844ab
Merge branch 'main' into fixNwMessageBtnCmntLnkng
tsa321 7553ed6
Revert route scheme
tsa321 abae889
Revert perf-test
tsa321 c498c92
Fix commment linking jumping around and new message button in android
tsa321 0993bd4
Revert changes
tsa321 c3bc9d1
Merge main
tsa321 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
prepage (
result[result.length - 1]
) could be same as page if the result contains only one pageThere 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.
@s77rt What? I don't understand. Could you elaborate please?
Do you mean when the sortedPages.length is 1. If it is 1 it won't even enter the for loop.
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.
If result length is 1, then:
page = sortedPages[0]
and
prevPage = sortedPages[0]
page is same as prevPage which is misleading and could cause bugs
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.
@s77rt Maybe I still don't understand.
The
i
in thefor
loop starts at 1, not 0, sopage = sortedPages[0]
is not possible. Consequently,page
andprevPage
won't be the same.Am I missing something?
const prevPage = result[result.length - 1];
Here I am using the last updated page of result and not the sortedPages.The end of
result
could be only 1 continuous page for for example10 pages
insortedPages
. Because the function merge the pages into one continuous page.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.
Ah right! my bad