mirror of
https://github.com/open-webui/open-webui
synced 2025-05-30 18:39:15 +00:00
fix
This commit is contained in:
parent
8ce5c2eaf0
commit
cad31f6f2b
@ -50,12 +50,7 @@
|
|||||||
pinned = await getChatPinnedStatusById(localStorage.token, chatId);
|
pinned = await getChatPinnedStatusById(localStorage.token, chatId);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getChatAsText = async () => {
|
const getChatAsText = async (chat) => {
|
||||||
const chat = await getChatById(localStorage.token, chatId);
|
|
||||||
if (!chat) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const history = chat.chat.history;
|
const history = chat.chat.history;
|
||||||
const messages = createMessagesList(history, history.currentId);
|
const messages = createMessagesList(history, history.currentId);
|
||||||
const chatText = messages.reduce((a, message, i, arr) => {
|
const chatText = messages.reduce((a, message, i, arr) => {
|
||||||
@ -66,8 +61,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const downloadTxt = async () => {
|
const downloadTxt = async () => {
|
||||||
const chatText = await getChatAsText();
|
const chat = await getChatById(localStorage.token, chatId);
|
||||||
|
if (!chat) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const chatText = await getChatAsText(chat);
|
||||||
let blob = new Blob([chatText], {
|
let blob = new Blob([chatText], {
|
||||||
type: 'text/plain'
|
type: 'text/plain'
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user