mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Greetings: Fix swipe on chat creation
Alternate greetings would cause a console error since chat extras didn't exist. To patch this, add an empty array if either value is nullish. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -6500,7 +6500,7 @@ const swipe_right = () => {
|
||||
} else if (parseInt(chat[chat.length - 1]['swipe_id']) < chat[chat.length - 1]['swipes'].length) { //otherwise, if the id is less than the number of swipes
|
||||
chat[chat.length - 1]['mes'] = chat[chat.length - 1]['swipes'][chat[chat.length - 1]['swipe_id']]; //load the last mes box with the latest generation
|
||||
chat[chat.length - 1]['send_date'] = chat[chat.length - 1]?.swipe_info[chat[chat.length - 1]['swipe_id']]?.send_date || chat[chat.length - 1]['send_date']; //update send date
|
||||
chat[chat.length - 1]['extra'] = JSON.parse(JSON.stringify(chat[chat.length - 1].swipe_info[chat[chat.length - 1]['swipe_id']]?.extra || chat[chat.length - 1].extra));
|
||||
chat[chat.length - 1]['extra'] = JSON.parse(JSON.stringify(chat[chat.length - 1].swipe_info[chat[chat.length - 1]['swipe_id']]?.extra || chat[chat.length - 1].extra || []));
|
||||
run_swipe_right = true; //then prepare to do normal right swipe to show next message
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user