Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
3b7775a5
Commit
3b7775a5
authored
Jan 15, 2024
by
Brandon Hulston
Browse files
Fix chat import bug
parent
26f7a1c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
src/lib/components/chat/SettingsModal.svelte
src/lib/components/chat/SettingsModal.svelte
+1
-1
src/routes/(app)/c/[id]/+page.svelte
src/routes/(app)/c/[id]/+page.svelte
+4
-2
No files found.
src/lib/components/chat/SettingsModal.svelte
View file @
3b7775a5
...
...
@@ -141,7 +141,7 @@
const importChats = async (_chats) => {
for (const chat of _chats) {
console.log(chat);
await createNewChat(localStorage.token, chat);
await createNewChat(localStorage.token,
chat.
chat);
}
await chats.set(await getChatList(localStorage.token));
...
...
src/routes/(app)/c/[id]/+page.svelte
View file @
3b7775a5
...
...
@@ -7,7 +7,7 @@
import { page } from '$app/stores';
import { models, modelfiles, user, settings, chats, chatId, config } from '$lib/stores';
import { copyToClipboard, splitStream } from '$lib/utils';
import { copyToClipboard, splitStream
, convertMessagesToHistory
} from '$lib/utils';
import { generateChatCompletion, generateTitle } from '$lib/apis/ollama';
import { createNewChat, getChatById, getChatList, updateChatById } from '$lib/apis/chats';
...
...
@@ -95,6 +95,8 @@
});
if (chat) {
console.log("Chat from getChatById1", chat) //Remove
console.log("Chat from getChatById2", chat.chat); // Remove
const chatContent = chat.chat;
if (chatContent) {
...
...
@@ -103,7 +105,7 @@
selectedModels =
(chatContent?.models ?? undefined) !== undefined
? chatContent.models
: [chatContent.model ?? ''];
: [chatContent.model
s
?? ''];
history =
(chatContent?.history ?? undefined) !== undefined
? chatContent.history
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment