From 8ea90444929341cc80ded06ff1038cd747cc4ed2 Mon Sep 17 00:00:00 2001 From: Spicy Marinara Date: Thu, 26 Feb 2026 01:47:42 +0100 Subject: [PATCH] Update src/core/persistence.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/core/persistence.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/persistence.js b/src/core/persistence.js index d0f011a..adeeb53 100644 --- a/src/core/persistence.js +++ b/src/core/persistence.js @@ -331,7 +331,13 @@ export function commitTrackerDataFromPriorMessage(currentMessageIndex) { const swipeData = getSwipeData(message, swipeId); committedTrackerData.userStats = swipeData?.userStats || null; committedTrackerData.infoBox = swipeData?.infoBox || null; - committedTrackerData.characterThoughts = swipeData?.characterThoughts || null; + const rawCharacterThoughts = swipeData?.characterThoughts; + committedTrackerData.characterThoughts = + rawCharacterThoughts == null + ? null + : (typeof rawCharacterThoughts === 'string' + ? rawCharacterThoughts + : JSON.stringify(rawCharacterThoughts)); return; }