From b7f3607f48528546f7b9c5d5249ab602da6020b8 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 22 Nov 2023 13:02:02 -0800 Subject: [PATCH] fix: db object --- src/routes/(app)/+layout.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 06ab1bff..4f4d5200 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -110,7 +110,7 @@ console.log(chat); await this.addChat(chat); } - await chats.set(await this.db.getChats()); + await chats.set(await this.getChats()); }, addChat: async function (chat) { await this.db.put('chats', { @@ -119,7 +119,7 @@ }, createNewChat: async function (chat) { 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) { const chat = await this.getChatById(id); @@ -130,17 +130,17 @@ timestamp: Date.now() }); - await chats.set(await this.db.getChats()); + await chats.set(await this.getChats()); }, deleteChatById: async function (id) { await this.db.delete('chats', id); - await chats.set(await this.db.getChats()); + await chats.set(await this.getChats()); }, deleteAllChat: async function () { const tx = this.db.transaction('chats', 'readwrite'); await Promise.all([tx.store.clear(), tx.done]); - await chats.set(await this.db.getChats()); + await chats.set(await this.getChats()); } }; };