From 171a84e7a2e80c440c72c9e655e1a2844d3270bc Mon Sep 17 00:00:00 2001 From: Grzegorz Gidel Date: Sat, 29 Apr 2023 20:56:05 +0200 Subject: [PATCH] Fix truncated swipes when multigen is enabled --- public/script.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index df75244e1..5b9d5b56b 100644 --- a/public/script.js +++ b/public/script.js @@ -2321,7 +2321,7 @@ function saveReply(type, getMessage, this_mes_is_name) { getMessage = img.getMessage; if (type === 'swipe') { - chat[chat.length - 1]['swipes'][chat[chat.length - 1]['swipes'].length] = getMessage; + chat[chat.length - 1]['swipes'].length++; if (chat[chat.length - 1]['swipe_id'] === chat[chat.length - 1]['swipes'].length - 1) { //console.log(getMessage); chat[chat.length - 1]['mes'] = getMessage; @@ -2364,6 +2364,12 @@ function saveReply(type, getMessage, this_mes_is_name) { saveImageToMessage(img, chat[chat.length - 1]); addOneMessage(chat[chat.length - 1]); } + + const item = chat[chat.length - 1]; + if (item['swipe_id'] !== undefined) { + item['swipes'][item['swipes'].length - 1] = item['mes']; + } + return { type, getMessage }; }