File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/diff-controls Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { useNotificationStore } from '@/stores/notifications'
88import { useCopilotStore , usePanelStore } from '@/stores/panel'
99import { useTerminalStore } from '@/stores/terminal'
1010import { useWorkflowDiffStore } from '@/stores/workflow-diff'
11+ import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
1112
1213const logger = createLogger ( 'DiffControls' )
1314const 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' )
You can’t perform that action at this time.
0 commit comments