diff --git a/apps/web/src/components/common/editor/MindEditor.tsx b/apps/web/src/components/common/editor/MindEditor.tsx index bd4c877..b1d4a39 100755 --- a/apps/web/src/components/common/editor/MindEditor.tsx +++ b/apps/web/src/components/common/editor/MindEditor.tsx @@ -24,7 +24,7 @@ const MIND_OPTIONS = { draggable: true, contextMenu: true, toolBar: true, - //nodeMenu: true, + nodeMenu: true, keypress: true, locale: "zh_CN" as const, theme: { @@ -67,7 +67,7 @@ export default function MindEditor({ id }: { id?: string }) { const canEdit: boolean = useMemo(() => { //登录了且是作者、超管、无id新建模式 const isAuth = isAuthenticated && user?.id == post?.authorId; - return !id || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST); + return !Boolean(id) || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST); }, [user]) const navigate = useNavigate(); const { create, update } = usePost(); @@ -183,14 +183,11 @@ export default function MindEditor({ id }: { id?: string }) { ); }; return ( -