Skip to content

Commit ce81ad6

Browse files
committed
fix: build related issues and import cleanups
1 parent e6b6ccb commit ce81ad6

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

src/app/ask-anything/[chatId]/_components/WelcomeCards.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useEffect, useMemo, useState } from 'react'
22
import Image from 'next/image'
33
import { usePathname, useRouter } from 'next/navigation'
44

5-
import { store } from '@/app/_utils/store'
65
import useStore from '@/app/_utils/store/store'
76
import { Alert, AlertDescription } from '@/components/ui/alert'
87
import { Card } from '@/components/ui/card'

src/app/ask-anything/[chatId]/utils/creatNewChat.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import { addChat, getAllChats, getChat } from '@/app/_lib/db'
2-
import { store } from '@/app/_utils/store'
3-
import useStore from '@/app/_utils/store/store'
1+
import { addChat, Chat, getAllChats, getChat } from '@/app/_lib/db'
42

5-
export async function addAndSelectChat(setSelectedChat, setChats) {
3+
export async function addAndSelectChat(
4+
setSelectedChat: (chat: Chat | undefined) => void,
5+
setChats: (newChats: Chat[]) => void,
6+
) {
67
const apiKey = localStorage.getItem('openai:key')
78
if (apiKey?.length) {
89
let chatId = await addChat({})
910
const selectedChat = await getChat({ id: chatId })
1011
const chats = await getAllChats()
11-
// setChats(chats)
12+
setSelectedChat(selectedChat)
13+
setChats(chats)
1214
return chatId
1315
}
1416
return 0

src/components/common/Header/Header.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import { useEffect, useRef, useState } from 'react'
44
import Image from 'next/image'
55
import Link from 'next/link'
66
import { usePathname } from 'next/navigation'
7-
import { Bolt, ExternalLink, Settings } from 'lucide-react'
7+
import { ExternalLink, Settings } from 'lucide-react'
88
import { toast } from 'sonner'
99

10-
import { store } from '@/app/_utils/store'
1110
import useStore from '@/app/_utils/store/store'
1211
import { ModeToggle } from '@/components/Providers/ThemeProvider'
1312
import { Button } from '@/components/ui/button'
@@ -98,7 +97,7 @@ export const ConfigDialogue = () => {
9897
// Use the stored value in the cleanup function
9998
closeBtn?.click()
10099
}
101-
}, [isConfigOpen, set])
100+
}, [isConfigOpen, toggleConfigOpen])
102101

103102
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
104103
setFormValues({

src/components/common/_components/ChatButtonsHeader.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { ExternalLink, Settings, Trash } from 'lucide-react'
77
import { toast } from 'sonner'
88

99
import { deleteAllMessages_aRS } from '@/app/_lib/db'
10-
import { store } from '@/app/_utils/store'
1110
import useStore from '@/app/_utils/store/store'
1211
import { Button } from '@/components/ui/button'
1312
import {
@@ -21,7 +20,7 @@ import {
2120
} from '@/components/ui/dialog'
2221
import { Input } from '@/components/ui/input'
2322
import { Label } from '@/components/ui/label'
24-
import { configPaths, isPath } from '../Header/constants'
23+
import { isPath } from '../Header/constants'
2524

2625
export default function ChatHeader() {
2726
const pathname = usePathname()

0 commit comments

Comments
 (0)