Conversation
Bound pageIndex to valid range based on filtered results so searching while on page 2+ shows results instead of empty page. The original pageIndex is preserved so clearing the search returns to the same page.
|
|
||
| // Message Table rendering variables and functions | ||
| // Bound pageIndex to valid range based on filtered results | ||
| const totalPages = Math.max(1, Math.ceil(filteredMessages.length / pageSize)); |
There was a problem hiding this comment.
isn't there some util function for this already?, if not shouldn't there be some?
|
@claude review |
|
Claude finished @malinskibeniamin's task in 1m 23s —— View job Code Review
|

Summary
Fixes an issue where searching/filtering messages while on page 2+ would show no results because the pagination index exceeded the filtered result set.
Changes
pageIndexto valid range based on filtered results countpageIndexstate so clearing the search returns to the same pageTest plan