Fix welcome page freezing

This commit is contained in:
kwaroran
2024-11-02 16:48:17 +09:00
parent 8937a9c6e2
commit 5dcb934069

View File

@@ -93,12 +93,20 @@
} }
function getCbsCondition(){ function getCbsCondition(){
try{
const cbsConditions:CbsConditions = { const cbsConditions:CbsConditions = {
firstmsg: firstMessage ?? false, firstmsg: firstMessage ?? false,
chatRole: DBState.db.characters[$selectedCharID].chats[DBState.db.characters[$selectedCharID].chatPage]?.message?.[idx]?.role ?? null, chatRole: DBState.db.characters[$selectedCharID].chats[DBState.db.characters[$selectedCharID].chatPage]?.message?.[idx]?.role ?? null,
} }
return cbsConditions return cbsConditions
} }
catch(e){
return {
firstmsg: firstMessage ?? false,
chatRole: null,
}
}
}
function displaya(message:string){ function displaya(message:string){
msgDisplay = risuChatParser(message, {chara: name, chatID: idx, rmVar: true, visualize: true, cbsConditions: getCbsCondition()}) msgDisplay = risuChatParser(message, {chara: name, chatID: idx, rmVar: true, visualize: true, cbsConditions: getCbsCondition()})