Skip to content

Commit ab2bb34

Browse files
committed
fix: remote double measurement on load, as the observer takes care of that now
1 parent a2272c3 commit ab2bb34

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

packages/webui/src/client/lib/VirtualElement.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export function VirtualElement({
6464
className?: string
6565
}>): JSX.Element | null {
6666
const resizeObserverManager = ElementObserverManager.getInstance()
67-
const [waitForInitialLoad, setWaitForInitialLoad] = useState(true)
6867
const [inView, setInView] = useState(initialShow ?? false)
6968
const [isShowingChildren, setIsShowingChildren] = useState(inView)
7069

@@ -197,26 +196,6 @@ export function VirtualElement({
197196
}, [ref, inView])
198197

199198
useEffect(() => {
200-
if (inView === true) {
201-
setIsShowingChildren(true)
202-
203-
// Schedule a measurement after a short delay
204-
if (waitForInitialLoad && ref) {
205-
const initialMeasurementTimeout = window.setTimeout(() => {
206-
const measurements = measureElement(ref, placeholderHeight)
207-
if (measurements) {
208-
setMeasurements(measurements)
209-
setWaitForInitialLoad(false)
210-
}
211-
}, 800)
212-
213-
return () => {
214-
window.clearTimeout(initialMeasurementTimeout)
215-
}
216-
}
217-
return
218-
}
219-
220199
let idleCallback: number | undefined
221200
let optimizeTimeout: number | undefined
222201

packages/webui/src/client/ui/SegmentTimeline/SegmentTimelineContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,6 @@ const SegmentTimelineContainerContent = withResolvedSegment(
547547

548548
this.visibilityChangeTimeout = setTimeout(() => {
549549
if (entries[0].intersectionRatio < 0.99 && !isMaintainingFocus() && Date.now() - this.mountedTime > 2000) {
550-
console.log('Segment out of view :', this.props.segmentId)
551550
if (typeof this.props.onSegmentScroll === 'function') this.props.onSegmentScroll()
552551
this.isVisible = false
553552
} else {

0 commit comments

Comments
 (0)