@@ -16,6 +16,7 @@ import {
1616 Tooltip ,
1717} from '@deephaven/components' ;
1818import './ConsoleStatusBar.scss' ;
19+ import { EMPTY_FUNCTION } from '@deephaven/utils' ;
1920
2021const POPPER_OPTIONS : PopperOptions = { placement : 'bottom-end' } ;
2122
@@ -32,19 +33,19 @@ function ConsoleStatusBar({
3233 session,
3334 overflowActions,
3435} : ConsoleStatusBarProps ) : ReactElement {
35- const [ isCommandRunning , setIsCommandRunning ] = useState ( false ) ;
36+ const [ pendingCommandCount , setPendingCommandCount ] = useState ( 0 ) ;
3637
3738 const handleCommandStarted = useCallback ( async ( event : CustomEvent ) => {
38- setIsCommandRunning ( true ) ;
39+ setPendingCommandCount ( count => count + 1 ) ;
3940
40- const { result } = event . detail ;
4141 try {
42+ const { result } = event . detail ;
4243 await result ;
4344 } catch ( error ) {
4445 // No-op, fall through
4546 }
4647
47- setIsCommandRunning ( false ) ;
48+ setPendingCommandCount ( count => count - 1 ) ;
4849 } , [ ] ) ;
4950
5051 useEffect (
@@ -66,7 +67,7 @@ function ConsoleStatusBar({
6667
6768 let statusIconClass = null ;
6869 let tooltipText = null ;
69- if ( isCommandRunning ) {
70+ if ( pendingCommandCount > 0 ) {
7071 // Connected, Pending
7172 statusIconClass = 'console-status-icon-pending' ;
7273 tooltipText = 'Worker is busy' ;
@@ -93,9 +94,7 @@ function ConsoleStatusBar({
9394 icon = { vsKebabVertical }
9495 tooltip = "More Actions..."
9596 aria-label = "More Actions..."
96- onClick = { ( ) => {
97- // no-op: click is handled in `DropdownMenu`
98- } }
97+ onClick = { EMPTY_FUNCTION }
9998 >
10099 < DropdownMenu
101100 actions = { overflowActions }
0 commit comments