From 97e4b41bc2809354f70762b33d2db1387e4e71a6 Mon Sep 17 00:00:00 2001 From: RossAscends Date: Thu, 18 Sep 2025 03:42:20 +0900 Subject: [PATCH] mobile: only autoclose char panel if it's actually open --- public/script.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 15695d343..572215d2e 100644 --- a/public/script.js +++ b/public/script.js @@ -813,7 +813,12 @@ export async function selectCharacterById(id, { switchMenu = true } = {}) { select_selected_character(this_chid, { switchMenu }); } - if (isMobile()) { + //close open char panel if it was already open + //avoids opening the char panel via Welcome Screen recent chats + //or other means of calling this function (such as QRs with /go). + //there should be no cases on mobile where char panel is open and + //you're able to get here other than an avatar click. + if (isMobile() && $('#rightNavDrawerIcon').hasClass('openIcon')) { $('#rightNavDrawerIcon').trigger('click'); } }