Skip to content

Commit 6d2199d

Browse files
Update sidebar.tsx
1 parent 813c40e commit 6d2199d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/sidebar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export const Sidebar: React.FC<SidebarProps> = ({
6767
};
6868

6969
const handleDeleteChat = async (chatId: string) => {
70-
await deleteProject(chatId);
70+
const supabase = createBrowserClient();
71+
await deleteProject(supabase, chatId);
7172
setChatHistory(chatHistory.filter(chat => chat.id !== chatId));
7273
};
7374

@@ -119,7 +120,7 @@ export const Sidebar: React.FC<SidebarProps> = ({
119120
}
120121

121122
const fetchChatHistory = async () => {
122-
const projects = await getProjects();
123+
const projects = await getProjects(supabase);
123124
const history = projects.map((project: Project) => ({
124125
id: project.id,
125126
title: project.title,
@@ -440,4 +441,4 @@ export const Sidebar: React.FC<SidebarProps> = ({
440441
<PricingModal isOpen={isPricingModalOpen} onClose={() => setIsPricingModalOpen(false)} />
441442
</div>
442443
);
443-
};
444+
};

0 commit comments

Comments
 (0)