client: fix comment to login

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