mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 20:35:19 +00:00
fix: dynamically determine page size
- larger screens where chat list (35px*pageSize) is smaller than window.InnerHeight, will not be able to scroll. - performance can dynamically scale, allowing mobile devices to load only what they need.
This commit is contained in:
parent
6847c2fc8c
commit
067d76fece
1 changed files with 4 additions and 2 deletions
|
|
@ -56,8 +56,10 @@
|
|||
let nextPageLoading = false;
|
||||
let tagView = false;
|
||||
let chatPagniationComplete = false;
|
||||
|
||||
pageLimit.set(20);
|
||||
// number of chats per page depends on screen size.
|
||||
// 35px is the height of each chat item.
|
||||
// load 5 extra chats
|
||||
pageLimit.set(Math.round(window.innerHeight / 35) + 5);
|
||||
|
||||
$: filteredChatList = $chats.filter((chat) => {
|
||||
if (search === '') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue