Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Fix & Feat UI/UX Page [JSON Exporter] #110

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/components/exporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,13 @@ export function JsonPreviewer(props: {
messages: ChatMessage[];
topic: string;
}) {
const chatStore = useChatStore();
const session = chatStore.currentSession();
const memoryPrompt = session.memoryPrompt;
const systemMessage = memoryPrompt || "";
const msgs = {
messages: [
...(systemMessage ? [{ role: "system", content: systemMessage }] : []),
...props.messages.map((m) => ({
role: m.role,
content: m.content,
Expand All @@ -699,7 +704,7 @@ export function JsonPreviewer(props: {
copyToClipboard(minifiedJson);
};
const download = () => {
downloadAs((msgs), `${props.topic}.json`);
downloadAs(msgs, `${props.topic}.json`); // Pass msgs instead of (msgs) to the downloadAs function
};

return (
Expand All @@ -711,7 +716,7 @@ export function JsonPreviewer(props: {
messages={props.messages}
/>
<div className="markdown-body" onClick={copy}>
<Markdown content={mdText} />
<Markdown content={mdText} />
</div>
</>
);
Expand Down