fix ctrl+up when sys msg is last

This commit is contained in:
RossAscends 2023-07-31 03:37:49 +09:00
parent 638050a3de
commit 9cb70817c7
1 changed files with 2 additions and 3 deletions

View File

@ -1048,11 +1048,10 @@ $("document").ready(function () {
}
if (event.ctrlKey && event.key == "ArrowUp") { //edits last USER message if chatbar is empty and focused
console.debug('got ctrl+uparrow input');
if (
$("#send_textarea").val() === '' &&
chatbarInFocus === true &&
$(".swipe_right:last").css('display') === 'flex' &&
($(".swipe_right:last").css('display') === 'flex' || $('.last_mes').attr('is_system') === 'true') &&
$("#character_popup").css("display") === "none" &&
$("#shadow_select_chat_popup").css("display") === "none"
) {
@ -1060,7 +1059,7 @@ $("document").ready(function () {
const lastIsUserMes = isUserMesList[isUserMesList.length - 1];
const editMes = lastIsUserMes.querySelector('.mes_block .mes_edit');
if (editMes !== null) {
$(editMes).click();
$(editMes).trigger('click');
}
}
}