Revert loadpages behavior dude to bugs

This commit is contained in:
kwaroran
2024-04-07 10:28:27 +09:00
parent 93c2e0c04c
commit ba5c210463

View File

@@ -29,8 +29,7 @@
let messageInput:string = ''
let messageInputTranslate:string = ''
let openMenu = false
let loadPages = 10
let lastLoadedChatId = ''
let loadPages = 30
let autoMode = false
let rerolls:Message[][] = []
let rerollid = -1
@@ -49,17 +48,6 @@
return sendMain(true)
}
function getLoadPages(){
if(!$CurrentChat.id){
$CurrentChat.id = v4()
}
if($CurrentChat.id !== lastLoadedChatId){
lastLoadedChatId = $CurrentChat.id
loadPages = 10
}
return loadPages
}
async function sendMain(continueResponse:boolean) {
let selectedChar = $selectedCharID
if($doingChat){
@@ -409,7 +397,7 @@
//@ts-ignore
const scrolled = (e.target.scrollHeight - e.target.clientHeight + e.target.scrollTop)
if(scrolled < 100 && $CurrentChat.message.length > loadPages){
loadPages += 10
loadPages += 15
}
}}>
<div class="flex items-end mt-2 mb-2 w-full">
@@ -529,7 +517,7 @@
)} {send}/>
{/if}
{#each messageForm($CurrentChat.message, getLoadPages()) as chat, i}
{#each messageForm($CurrentChat.message, loadPages) as chat, i}
{#if chat.role === 'char'}
{#if $CurrentCharacter.type !== 'group'}
<Chat
@@ -573,7 +561,7 @@
/>
{/if}
{/each}
{#if $CurrentChat.message.length <= getLoadPages()}
{#if $CurrentChat.message.length <= loadPages}
{#if $CurrentCharacter.type !== 'group'}
<Chat
character={$CurrentSimpleCharacter}