mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix logprobs menu on empty chats
This commit is contained in:
@ -496,9 +496,13 @@ function getMessageHash(message) {
|
||||
/**
|
||||
* getActiveMessageLogprobData returns the logprobs data for the active chat
|
||||
* message.
|
||||
* @returns {MessageLogprobData || null}
|
||||
* @returns {MessageLogprobData|null}
|
||||
*/
|
||||
function getActiveMessageLogprobData() {
|
||||
if (chat.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const hash = getMessageHash(chat[chat.length - 1]);
|
||||
return state.messageLogprobs.get(hash) || null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user