Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): Sidebar create new chat context #1569

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading