diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 24e74e695..2da9d1a8e 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -25,7 +25,9 @@ user, socket, showCallOverlay, - tools + tools, + pageSkip, + pageLimit } from '$lib/stores'; import { convertMessagesToHistory, @@ -418,7 +420,9 @@ params: params, files: chatFiles }); - await chats.set(await getChatList(localStorage.token)); + await chats.set( + await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit) + ); } } }; @@ -464,7 +468,9 @@ params: params, files: chatFiles }); - await chats.set(await getChatList(localStorage.token)); + await chats.set( + await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit) + ); } } }; @@ -624,7 +630,9 @@ tags: [], timestamp: Date.now() }); - await chats.set(await getChatList(localStorage.token)); + await chats.set( + await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit) + ); await chatId.set(chat.id); } else { await chatId.set('local'); @@ -700,7 +708,8 @@ }) ); - await chats.set(await getChatList(localStorage.token)); + await chats.set(await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit)); + return _responses; }; @@ -947,7 +956,9 @@ params: params, files: chatFiles }); - await chats.set(await getChatList(localStorage.token)); + await chats.set( + await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit) + ); } } } else { @@ -1220,7 +1231,9 @@ params: params, files: chatFiles }); - await chats.set(await getChatList(localStorage.token)); + await chats.set( + await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit) + ); } } } else { @@ -1385,7 +1398,9 @@ if ($settings.saveChatHistory ?? true) { chat = await updateChatById(localStorage.token, _chatId, { title: _title }); - await chats.set(await getChatList(localStorage.token)); + await chats.set( + await getChatList(localStorage.token, 0, $pageSkip * $pageLimit || $pageLimit) + ); } }; diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index e46e93143..c798de923 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -1,6 +1,6 @@