fix retrieval of currentChatID for renamed chars

This commit is contained in:
RossAscends
2023-11-06 01:23:34 +09:00
parent a5b5dfdcb6
commit 304aa38f24

View File

@@ -597,11 +597,12 @@ function reloadMarkdownProcessor(render_formulas = false) {
}
function getCurrentChatId() {
console.debug(`selectedGroup:${selected_group}, this_chid:${this_chid}`)
if (selected_group) {
return groups.find(x => x.id == selected_group)?.chat_id;
}
else if (this_chid) {
return characters[this_chid].chat;
return characters[this_chid]?.chat;
}
}