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
b7f3607f
Commit
b7f3607f
authored
Nov 22, 2023
by
Timothy J. Baek
Browse files
fix: db object
parent
b7030c00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/routes/(app)/+layout.svelte
src/routes/(app)/+layout.svelte
+5
-5
No files found.
src/routes/(app)/+layout.svelte
View file @
b7f3607f
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
console.log(chat);
console.log(chat);
await this.addChat(chat);
await this.addChat(chat);
}
}
await chats.set(await this.
db.
getChats());
await chats.set(await this.getChats());
},
},
addChat: async function (chat) {
addChat: async function (chat) {
await this.db.put('chats', {
await this.db.put('chats', {
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
},
},
createNewChat: async function (chat) {
createNewChat: async function (chat) {
await this.addChat({ ...chat, timestamp: Date.now() });
await this.addChat({ ...chat, timestamp: Date.now() });
await chats.set(await this.
db.
getChats());
await chats.set(await this.getChats());
},
},
updateChatById: async function (id, updated) {
updateChatById: async function (id, updated) {
const chat = await this.getChatById(id);
const chat = await this.getChatById(id);
...
@@ -130,17 +130,17 @@
...
@@ -130,17 +130,17 @@
timestamp: Date.now()
timestamp: Date.now()
});
});
await chats.set(await this.
db.
getChats());
await chats.set(await this.getChats());
},
},
deleteChatById: async function (id) {
deleteChatById: async function (id) {
await this.db.delete('chats', id);
await this.db.delete('chats', id);
await chats.set(await this.
db.
getChats());
await chats.set(await this.getChats());
},
},
deleteAllChat: async function () {
deleteAllChat: async function () {
const tx = this.db.transaction('chats', 'readwrite');
const tx = this.db.transaction('chats', 'readwrite');
await Promise.all([tx.store.clear(), tx.done]);
await Promise.all([tx.store.clear(), tx.done]);
await chats.set(await this.
db.
getChats());
await chats.set(await this.getChats());
}
}
};
};
};
};
...
...
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