mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-10 22:41:17 +00:00
Optimize onboarding chat document creation with Promise.all
This commit is contained in:
parent
7b64ce1e10
commit
1b40cedd23
1 changed files with 5 additions and 1 deletions
|
|
@ -40,6 +40,10 @@ interface DraftDoc {
|
|||
}
|
||||
|
||||
export function ChatSidebar({ formData }: ChatSidebarProps) {
|
||||
const isValidDocId = (
|
||||
id: string | null | undefined,
|
||||
): id is string => !!id
|
||||
|
||||
const { user } = useAuth()
|
||||
const { selectedProject } = useProject()
|
||||
const isMobile = useIsMobile()
|
||||
|
|
@ -397,7 +401,7 @@ export function ChatSidebar({ formData }: ChatSidebarProps) {
|
|||
},
|
||||
})
|
||||
|
||||
if (docResponse.data?.id) {
|
||||
if (isValidDocId(docResponse.data?.id)) {
|
||||
documentIds.push(docResponse.data.id)
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue