Update src/systems/integration/sillytavern.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Spicy Marinara
2026-02-26 01:48:15 +01:00
committed by GitHub
parent 8ea9044492
commit ce48ac0c34
+8 -1
View File
@@ -114,7 +114,14 @@ export function commitTrackerData() {
// console.log('[RPG Companion] Committing tracker data from assistant message at index', i, 'swipe', swipeId);
committedTrackerData.userStats = swipeData.userStats || null;
committedTrackerData.infoBox = swipeData.infoBox || null;
committedTrackerData.characterThoughts = swipeData.characterThoughts || null;
const rawCharacterThoughts = swipeData.characterThoughts;
if (rawCharacterThoughts == null) {
committedTrackerData.characterThoughts = null;
} else if (typeof rawCharacterThoughts === 'object') {
committedTrackerData.characterThoughts = JSON.stringify(rawCharacterThoughts);
} else {
committedTrackerData.characterThoughts = String(rawCharacterThoughts);
}
} else {
// No saved swipe data — treat as empty (e.g. first message, no prior generation)
committedTrackerData.userStats = null;