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;
|
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}`);
|
console.warn(`[syncMesToSwipe] Invalid message ID: ${messageId}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetMessage = chat[targetMessageId];
|
const targetMessage = chat[targetMessageId];
|
||||||
|
|
||||||
|
if (!targetMessage) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// No swipe data there yet, exit out
|
// No swipe data there yet, exit out
|
||||||
if (typeof targetMessage.swipe_id !== 'number') {
|
if (typeof targetMessage.swipe_id !== 'number') {
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user