From 91327af5bac32dec105bd8be711996c3cab8432d Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Mon, 24 Mar 2025 15:32:01 -0700 Subject: [PATCH] fix(console): flashing on run --- sim/app/w/[id]/hooks/use-workflow-execution.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sim/app/w/[id]/hooks/use-workflow-execution.ts b/sim/app/w/[id]/hooks/use-workflow-execution.ts index cc0909ce76..74eb53ec90 100644 --- a/sim/app/w/[id]/hooks/use-workflow-execution.ts +++ b/sim/app/w/[id]/hooks/use-workflow-execution.ts @@ -19,7 +19,7 @@ export function useWorkflowExecution() { const { blocks, edges, loops } = useWorkflowStore() const { activeWorkflowId } = useWorkflowRegistry() const { addNotification } = useNotificationStore() - const { toggleConsole, isOpen } = useConsoleStore() + const { toggleConsole } = useConsoleStore() const { getAllVariables } = useEnvironmentStore() const { isExecuting, setIsExecuting } = useExecutionStore() const [executionResult, setExecutionResult] = useState(null) @@ -59,8 +59,11 @@ export function useWorkflowExecution() { if (!activeWorkflowId) return setIsExecuting(true) + // Get the current console state directly from the store + const currentIsOpen = useConsoleStore.getState().isOpen + // Open console if it's not already open - if (!isOpen) { + if (!currentIsOpen) { toggleConsole() } @@ -194,7 +197,6 @@ export function useWorkflowExecution() { edges, loops, addNotification, - isOpen, toggleConsole, getAllVariables, setIsExecuting,