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; }