Skip to content

Commit

Permalink
fix(web): Sidebar create new chat context (#1569)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunIce authored Nov 20, 2023
1 parent 657334a commit ac3496e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/app/components/share/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ const Main: FC<IMainProps> = ({
onUnpin={handleUnpin}
controlUpdateList={controlUpdateConversationList}
onDelete={handleDelete}
onStartChat={handleStartChat}
/>
)
}
Expand Down
4 changes: 3 additions & 1 deletion web/app/components/share/chat/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type ISidebarProps = {
onUnpin: (id: string) => void
controlUpdateList: number
onDelete: (id: string) => void
onStartChat: (inputs: Record<string, any>) => void
}

const Sidebar: FC<ISidebarProps> = ({
Expand All @@ -59,6 +60,7 @@ const Sidebar: FC<ISidebarProps> = ({
onUnpin,
controlUpdateList,
onDelete,
onStartChat,
}) => {
const { t } = useTranslation()
const [hasPinned, setHasPinned] = useState(false)
Expand Down Expand Up @@ -104,7 +106,7 @@ const Sidebar: FC<ISidebarProps> = ({
)}
<div className="flex flex-shrink-0 p-4 !pb-0">
<Button
onClick={() => { onCurrentIdChange('-1') }}
onClick={() => onStartChat({})}
className="group block w-full flex-shrink-0 !justify-start !h-9 text-primary-600 items-center text-sm">
<PencilSquareIcon className="mr-2 h-4 w-4" /> {t('share.chat.newChat')}
</Button>
Expand Down

0 comments on commit ac3496e

Please sign in to comment.