clean history on import

This commit is contained in:
Mckay Wrigley
2023-03-23 19:08:20 -06:00
parent 93b528f10d
commit 9d88722f35
+2 -1
View File
@@ -1,4 +1,5 @@
import { ChatFolder, Conversation } from "@/types";
import { cleanConversationHistory } from "@/utils/app/clean";
import { IconFileImport } from "@tabler/icons-react";
import { FC } from "react";
@@ -22,7 +23,7 @@ export const Import: FC<Props> = ({ onImport }) => {
let json = JSON.parse(e.target?.result as string);
if (!json.folders) {
json = { history: json, folders: [] };
json = { history: cleanConversationHistory(json), folders: [] };
}
onImport({ conversations: json.history, folders: json.folders });