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

Fix out of bound index in chat paging #3480

Merged
merged 1 commit into from
Jun 16, 2023
Merged

Fix out of bound index in chat paging #3480

merged 1 commit into from
Jun 16, 2023

Conversation

someone13574
Copy link
Contributor

closes #3478

useIsomorphicLayoutEffect wasn't being called until the first render meaning if the index could be out of bounds if the parent message was changed to a tree with less siblings than the previous. A simple min against the number of siblings prevents the out of bound index and then useIsomorphicLayoutEffect is called the next frame, setting the correct thread.

Copy link
Collaborator

@notmd notmd left a comment

Choose a reason for hiding this comment

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

Thanks

@notmd notmd merged commit e1ed96a into LAION-AI:main Jun 16, 2023
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.

Chat error: "Cannot read properties of undefined (reading 'children')"
2 participants