-
Notifications
You must be signed in to change notification settings - Fork 540
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 files selection #4764
Fix files selection #4764
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const nextFile = | ||
fileIndex !== -1 && fileIndex + 1 < files.length ? files[fileIndex + 1] : undefined; | ||
return nextFile; |
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.
It looks like this is a no-op change?
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.
I'm checking if fileIndex is greater than 0 and within the bounds of the files array. If both conditions are true, the code returns the next file in the array. Otherwise, it returns undefined.
Can you suggest a better solution here?
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.
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, I see. Sure, I'll fixed that
62323fd
to
71eca8f
Compare
71eca8f
to
851d652
Compare
return fileIndex > 0 ? files[fileIndex - 1] : undefined; | ||
const previousFile = fileIndex > 0 ? files[fileIndex - 1] : undefined; | ||
return previousFile; |
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.
Same thing here!
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.
Fixed :-)
☕️ Reasoning
commit id
and there wasn't any matches.remote
commitsdraggable
icon for unapplied commitsResult:
Screen.Recording.2024-08-26.at.23.44.57.mov
Related issue — #4734 (comment)