Skip to content

Fix out of bound index in chat paging - #3480

Merged
notmd merged 1 commit into
LAION-AI:mainfrom
someone13574:fix-out-of-bound-index
Jun 16, 2023
Merged

Fix out of bound index in chat paging#3480
notmd merged 1 commit into
LAION-AI:mainfrom
someone13574:fix-out-of-bound-index

Conversation

@someone13574

Copy link
Copy Markdown
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.

@notmd notmd left a comment

Copy link
Copy Markdown
Collaborator

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