Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

⬇️ refactor: Improve Conversation JSON Export (#10726)

Danny Avila2ccaf6be6dc2
diff --git a/client/src/hooks/Conversations/useExportConversation.ts b/client/src/hooks/Conversations/useExportConversation.ts
index 899189e206..25758f54b0 100644
--- a/client/src/hooks/Conversations/useExportConversation.ts
+++ b/client/src/hooks/Conversations/useExportConversation.ts
@@ -103,7 +103,7 @@ export default function useExportConversation({
if (content.type === ContentTypes.TEXT) {
// TEXT
const textPart = content[ContentTypes.TEXT];
- const text = typeof textPart === 'string' ? textPart : textPart.value;
+ const text = typeof textPart === 'string' ? textPart : (textPart?.value ?? '');
return [sender, text];
}
@@ -365,12 +365,8 @@ export default function useExportConversation({
data['messages'] = messages;
}
- exportFromJSON({
- data: data,
- fileName: filename,
- extension: 'json',
- exportType: exportFromJSON.types.json,
- });
+ /** Use JSON.stringify without indentation to minimize file size for deeply nested recursive exports */
+ download(JSON.stringify(data), `${filename}.json`, 'application/json');
};
const exportConversation = () => {