mirror of https://github.com/langgenius/dify.git
improve comment cursor move
This commit is contained in:
parent
37ecd4a0bc
commit
bf71300635
|
|
@ -4,12 +4,9 @@ import { useStore } from '../store'
|
|||
import { ControlMode } from '../types'
|
||||
import { Comment } from '@/app/components/base/icons/src/public/other'
|
||||
|
||||
type CommentCursorProps = {
|
||||
mousePosition: { elementX: number; elementY: number }
|
||||
}
|
||||
|
||||
export const CommentCursor: FC<CommentCursorProps> = memo(({ mousePosition }) => {
|
||||
export const CommentCursor: FC = memo(() => {
|
||||
const controlMode = useStore(s => s.controlMode)
|
||||
const mousePosition = useStore(s => s.mousePosition)
|
||||
|
||||
if (controlMode !== ControlMode.Comment)
|
||||
return null
|
||||
|
|
|
|||
|
|
@ -202,7 +202,6 @@ export const Workflow: FC<WorkflowProps> = memo(({
|
|||
} = useWorkflowComment()
|
||||
const showUserComments = useStore(s => s.showUserComments)
|
||||
const showUserCursors = useStore(s => s.showUserCursors)
|
||||
const mousePosition = useStore(s => s.mousePosition)
|
||||
const { t } = useTranslation()
|
||||
|
||||
eventEmitter?.useSubscription((v: any) => {
|
||||
|
|
@ -442,7 +441,7 @@ export const Workflow: FC<WorkflowProps> = memo(({
|
|||
)}
|
||||
<LimitTips />
|
||||
{controlMode === ControlMode.Comment && isMouseOverCanvas && (
|
||||
<CommentCursor mousePosition={mousePosition} />
|
||||
<CommentCursor />
|
||||
)}
|
||||
{pendingComment && (
|
||||
<CommentInput
|
||||
|
|
|
|||
Loading…
Reference in New Issue