File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
apps/sim/app/workspace/[workspaceId]/logs Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -530,18 +530,25 @@ export default function ExecutionsDashboard() {
530530 useEffect ( ( ) => {
531531 if ( ! barsAreaRef . current ) return
532532 const el = barsAreaRef . current
533+ let debounceId : any = null
533534 const ro = new ResizeObserver ( ( [ entry ] ) => {
534535 const w = entry ?. contentRect ?. width || 720
535536 const n = Math . max ( 36 , Math . min ( 96 , Math . floor ( w / MIN_SEGMENT_PX ) ) )
536- setSegmentCount ( n )
537+ if ( debounceId ) clearTimeout ( debounceId )
538+ debounceId = setTimeout ( ( ) => {
539+ setSegmentCount ( n )
540+ } , 150 )
537541 } )
538542 ro . observe ( el )
539543 const rect = el . getBoundingClientRect ( )
540544 if ( rect ?. width ) {
541545 const n = Math . max ( 36 , Math . min ( 96 , Math . floor ( rect . width / MIN_SEGMENT_PX ) ) )
542546 setSegmentCount ( n )
543547 }
544- return ( ) => ro . disconnect ( )
548+ return ( ) => {
549+ if ( debounceId ) clearTimeout ( debounceId )
550+ ro . disconnect ( )
551+ }
545552 } , [ ] )
546553
547554 const getShiftLabel = ( ) => {
You can’t perform that action at this time.
0 commit comments