client: fix comment to login

This commit is contained in:
fantasticit 2022-06-03 21:57:17 +08:00
parent 2d477ba698
commit c7eeb104b4
1 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ interface IProps {
const { Text, Paragraph } = Typography;
export const CommentEditor: React.FC<IProps> = ({ documentId }) => {
const { user, logout } = useUser();
const { user, toLogin } = useUser();
const {
data: commentsData,
loading,
@ -39,11 +39,11 @@ export const CommentEditor: React.FC<IProps> = ({ documentId }) => {
const openEditor = useCallback(() => {
if (!user) {
return logout();
return toLogin();
}
toggleIsEdit(true);
editor.chain().focus();
}, [editor, logout, toggleIsEdit, user]);
}, [editor, toLogin, toggleIsEdit, user]);
const handleClose = useCallback(() => {
setReplyComment(null);