Fix /addswipe error if swipe_info not initialized

This commit is contained in:
Wolfsblvt 2024-06-26 02:46:53 +02:00
parent 071a77fe1a
commit 9113fae4fe

View File

@ -1998,6 +1998,9 @@ async function addSwipeCallback(_, arg) {
lastMessage.swipe_info = [{}]; lastMessage.swipe_info = [{}];
lastMessage.swipe_id = 0; lastMessage.swipe_id = 0;
} }
if (!Array.isArray(lastMessage.swipe_info)) {
lastMessage.swipe_info = lastMessage.swipes.map(() => ({}));
}
lastMessage.swipes.push(arg); lastMessage.swipes.push(arg);
lastMessage.swipe_info.push({ lastMessage.swipe_info.push({