From 304aa38f24219930b50bc3c2730d7e555866d76b Mon Sep 17 00:00:00 2001 From: RossAscends <124905043+RossAscends@users.noreply.github.com> Date: Mon, 6 Nov 2023 01:23:34 +0900 Subject: [PATCH] fix retrieval of currentChatID for renamed chars --- public/script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index e72823212..011409dba 100644 --- a/public/script.js +++ b/public/script.js @@ -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; } } @@ -5774,7 +5775,7 @@ function select_rm_info(type, charId, previousCharId = null) { export function select_selected_character(chid) { //character select - //console.log('select_selected_character() -- starting with input of -- '+chid+' (name:'+characters[chid].name+')'); + //console.log('select_selected_character() -- starting with input of -- ' + chid + ' (name:' + characters[chid].name + ')'); select_rm_create(); menu_type = "character_edit"; $("#delete_button").css("display", "flex");