mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
(fix:action-buttons) redirect to conversations
This commit is contained in:
@@ -18,6 +18,8 @@ interface ActionButtonsProps {
|
|||||||
showShare?: boolean;
|
showShare?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
export default function ActionButtons({
|
export default function ActionButtons({
|
||||||
className = '',
|
className = '',
|
||||||
showNewChat = true,
|
showNewChat = true,
|
||||||
@@ -27,6 +29,7 @@ export default function ActionButtons({
|
|||||||
const dispatch = useDispatch<AppDispatch>();
|
const dispatch = useDispatch<AppDispatch>();
|
||||||
const conversationId = useSelector(selectConversationId);
|
const conversationId = useSelector(selectConversationId);
|
||||||
const [isShareModalOpen, setShareModalState] = useState<boolean>(false);
|
const [isShareModalOpen, setShareModalState] = useState<boolean>(false);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const newChat = () => {
|
const newChat = () => {
|
||||||
dispatch(setConversation([]));
|
dispatch(setConversation([]));
|
||||||
@@ -35,8 +38,8 @@ export default function ActionButtons({
|
|||||||
query: { conversationId: null },
|
query: { conversationId: null },
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
navigate('/');
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed right-4 top-4 z-10">
|
<div className="fixed right-4 top-4 z-10">
|
||||||
<div className={`flex items-center gap-2 sm:gap-4 ${className}`}>
|
<div className={`flex items-center gap-2 sm:gap-4 ${className}`}>
|
||||||
|
|||||||
Reference in New Issue
Block a user