Fix delete swipe button being inconsistent

- Fixes #2749
This commit is contained in:
Wolfsblvt 2024-09-01 23:21:51 +02:00
parent d663be53ac
commit e8d8915183

View File

@ -10323,20 +10323,13 @@ jQuery(async function () {
if (deleteOnlySwipe) {
const message = chat[this_edit_mes_id];
const swipe_id = message.swipe_id;
message.swipes.splice(swipe_id, 1);
if (Array.isArray(message.swipe_info) && message.swipe_info.length) {
message.swipe_info.splice(swipe_id, 1);
}
if (swipe_id > 0) {
$('.swipe_left:last').click();
} else {
$('.swipe_right:last').click();
}
} else {
chat.splice(this_edit_mes_id, 1);
messageElement.remove();
await deleteSwipe(swipe_id);
return;
}
chat.splice(this_edit_mes_id, 1);
messageElement.remove();
let startFromZero = Number(this_edit_mes_id) === 0;
this_edit_mes_id = undefined;