mirror of
https://github.com/open-webui/open-webui
synced 2024-11-06 08:56:39 +00:00
Merge pull request #522 from ollama-webui/import-chat-fix
fix: old chat log import issue
This commit is contained in:
commit
ff33aa37ae
@ -142,13 +142,20 @@
|
||||
importChats(chats);
|
||||
};
|
||||
|
||||
if (importFiles.length > 0) {
|
||||
reader.readAsText(importFiles[0]);
|
||||
}
|
||||
}
|
||||
|
||||
const importChats = async (_chats) => {
|
||||
for (const chat of _chats) {
|
||||
console.log(chat);
|
||||
|
||||
if (chat.chat) {
|
||||
await createNewChat(localStorage.token, chat.chat);
|
||||
} else {
|
||||
await createNewChat(localStorage.token, chat);
|
||||
}
|
||||
}
|
||||
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
|
Loading…
Reference in New Issue
Block a user