From 3f09a4c35549af678f429c1ec43b0fc8cd8ad280 Mon Sep 17 00:00:00 2001 From: Mckay Wrigley Date: Sat, 25 Mar 2023 10:13:51 -0600 Subject: [PATCH] hotfix --- components/Sidebar/Import.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Sidebar/Import.tsx b/components/Sidebar/Import.tsx index 10b90e6..c508ffa 100644 --- a/components/Sidebar/Import.tsx +++ b/components/Sidebar/Import.tsx @@ -1,16 +1,16 @@ import { ChatFolder, Conversation } from "@/types"; import { cleanConversationHistory } from "@/utils/app/clean"; import { IconFileImport } from "@tabler/icons-react"; +import { useTranslation } from "next-i18next"; import { FC } from "react"; import { SidebarButton } from "./SidebarButton"; -import { useTranslation } from "next-i18next"; interface Props { onImport: (data: { conversations: Conversation[]; folders: ChatFolder[] }) => void; } export const Import: FC = ({ onImport }) => { - const { t} = useTranslation('sidebar') + const { t } = useTranslation("sidebar"); return ( <> = ({ onImport }) => { reader.onload = (e) => { let json = JSON.parse(e.target?.result as string); - if (!json.folders) { + if (json && !json.folders) { json = { history: cleanConversationHistory(json), folders: [] }; }