fix: restore undefined value from null after importing hypaDataV3

This commit is contained in:
Bo26fhmC5M
2025-01-13 19:31:24 +09:00
parent a1158ebdb1
commit 4176a647a5
2 changed files with 8 additions and 6 deletions

View File

@@ -60,7 +60,8 @@ function toHypaV3Data(serialData: SerializableHypaV3Data): HypaV3Data {
return {
summaries: serialData.summaries.map((summary) => ({
text: summary.text,
chatMemos: new Set(summary.chatMemos),
// Convert null back to undefined (JSON serialization converts undefined to null)
chatMemos: new Set(summary.chatMemos.map(memo => memo === null ? undefined : memo)),
})),
};
}