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