fix(console): flashing on run

This commit is contained in:
Emir Karabeg
2025-03-24 15:32:01 -07:00
parent 4fbe825e2e
commit 91327af5ba

View File

@@ -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<ExecutionResult | null>(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,