mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
@@ -6148,13 +6148,17 @@ export function syncMesToSwipe(messageId = null) {
|
||||
}
|
||||
|
||||
const targetMessageId = messageId ?? chat.length - 1;
|
||||
if (chat.length > targetMessageId || targetMessageId < 0) {
|
||||
if (targetMessageId >= chat.length || targetMessageId < 0) {
|
||||
console.warn(`[syncMesToSwipe] Invalid message ID: ${messageId}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
const targetMessage = chat[targetMessageId];
|
||||
|
||||
if (!targetMessage) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// No swipe data there yet, exit out
|
||||
if (typeof targetMessage.swipe_id !== 'number') {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user