mobile: only autoclose char panel if it's actually open

97e4b41bc2809354f70762b33d2db1387e4e71a6

RossAscends <rossascendshamma@gmail.com>

1 files changed, +6 -1Ignore whitespace
public/script.js+6 -1
@@ -813,7 +813,12 @@ export async function selectCharacterById(id, { switchMenu = true } = {}) {
813 select_selected_character(this_chid, { switchMenu });813 select_selected_character(this_chid, { switchMenu });
814 }814 }
815815
816 if (isMobile()) {816 //close open char panel if it was already open
817 //avoids opening the char panel via Welcome Screen recent chats
818 //or other means of calling this function (such as QRs with /go).
819 //there should be no cases on mobile where char panel is open and
820 //you're able to get here other than an avatar click.
821 if (isMobile() && $('#rightNavDrawerIcon').hasClass('openIcon')) {
817 $('#rightNavDrawerIcon').trigger('click');822 $('#rightNavDrawerIcon').trigger('click');
818 }823 }
819}824}