mirror of https://github.com/fantasticit/think.git
client: fix comment to login
parent
2d477ba698
commit
c7eeb104b4
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue