fix: temp chat json export

This commit is contained in:
Timothy Jaeryang Baek 2025-01-05 01:10:45 -08:00
parent 6ed8c3cb70
commit c8be0ee1e0

View File

@ -83,12 +83,19 @@
const downloadJSONExport = async () => {
if (chat.id) {
chat = await getChatById(localStorage.token, chat.id);
let chatObj = null;
if (chat.id === 'local' || $temporaryChatEnabled) {
chatObj = chat;
} else {
chatObj = await getChatById(localStorage.token, chat.id);
}
let blob = new Blob([JSON.stringify([chatObj])], {
type: 'application/json'
});
saveAs(blob, `chat-export-${Date.now()}.json`);
}
let blob = new Blob([JSON.stringify([chat])], {
type: 'application/json'
});
saveAs(blob, `chat-export-${Date.now()}.json`);
};
</script>