Skip to content

Commit 40a7825

Browse files
committed
Fix copilot diff controls
1 parent ce3ddb6 commit 40a7825

File tree

1 file changed

+9
-1
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/diff-controls

1 file changed

+9
-1
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/diff-controls/diff-controls.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useNotificationStore } from '@/stores/notifications'
88
import { useCopilotStore, usePanelStore } from '@/stores/panel'
99
import { useTerminalStore } from '@/stores/terminal'
1010
import { useWorkflowDiffStore } from '@/stores/workflow-diff'
11+
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
1112

1213
const logger = createLogger('DiffControls')
1314
const NOTIFICATION_WIDTH = 240
@@ -37,8 +38,15 @@ export const DiffControls = memo(function DiffControls() {
3738
)
3839
)
3940

41+
const { activeWorkflowId } = useWorkflowRegistry(
42+
useCallback((state) => ({ activeWorkflowId: state.activeWorkflowId }), [])
43+
)
44+
4045
const allNotifications = useNotificationStore((state) => state.notifications)
41-
const hasVisibleNotifications = allNotifications.length > 0
46+
const hasVisibleNotifications = useMemo(() => {
47+
if (!activeWorkflowId) return false
48+
return allNotifications.some((n) => !n.workflowId || n.workflowId === activeWorkflowId)
49+
}, [allNotifications, activeWorkflowId])
4250

4351
const handleAccept = useCallback(() => {
4452
logger.info('Accepting proposed changes with backup protection')

0 commit comments

Comments
 (0)