From 351bad9ec42501b7de16eb16832e91bbf1b72fa5 Mon Sep 17 00:00:00 2001 From: hjlarry Date: Wed, 22 Oct 2025 10:21:25 +0800 Subject: [PATCH] fix minimap disable collobroation --- .../workflow/operator/zoom-in-out.tsx | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/web/app/components/workflow/operator/zoom-in-out.tsx b/web/app/components/workflow/operator/zoom-in-out.tsx index 4db3841bf2..5d2400bc92 100644 --- a/web/app/components/workflow/operator/zoom-in-out.tsx +++ b/web/app/components/workflow/operator/zoom-in-out.tsx @@ -30,6 +30,7 @@ import { PortalToFollowElemContent, PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' +import { useGlobalPublicStore } from '@/context/global-public-context' enum ZoomType { zoomIn = 'zoomIn', @@ -78,6 +79,7 @@ const ZoomInOut: FC = ({ workflowReadOnly, getWorkflowReadOnly, } = useWorkflowReadOnly() + const isCollaborationEnabled = useGlobalPublicStore(s => s.systemFeatures.enable_collaboration_mode) const ZOOM_IN_OUT_OPTIONS = [ [ @@ -106,20 +108,27 @@ const ZoomInOut: FC = ({ text: t('workflow.operator.zoomToFit'), }, ], - [ - { - key: ZoomType.toggleUserComments, - text: t('workflow.operator.showUserComments'), - }, - { - key: ZoomType.toggleUserCursors, - text: t('workflow.operator.showUserCursors'), - }, - { - key: ZoomType.toggleMiniMap, - text: t('workflow.operator.showMiniMap'), - }, - ], + isCollaborationEnabled + ? [ + { + key: ZoomType.toggleUserComments, + text: t('workflow.operator.showUserComments'), + }, + { + key: ZoomType.toggleUserCursors, + text: t('workflow.operator.showUserCursors'), + }, + { + key: ZoomType.toggleMiniMap, + text: t('workflow.operator.showMiniMap'), + }, + ] + : [ + { + key: ZoomType.toggleMiniMap, + text: t('workflow.operator.showMiniMap'), + }, + ], ] const handleZoom = (type: string) => {