Skip to content

Commit 1a243b6

Browse files
authored
Reduce Comparison "Image By Step" calls to backend (#4506)
1 parent 0fa0b07 commit 1a243b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webview/src/plots/components/comparisonTable/cell/ComparisonTableMultiCell.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ export const ComparisonTableMultiCell: React.FC<{
3030
useEffect(() => {
3131
window.clearTimeout(changeDebounceTimer.current)
3232
changeDebounceTimer.current = window.setTimeout(() => {
33-
if (currentStep === values?.[plot.id]?.[path]) {
33+
const isOnMount =
34+
values?.[plot.id]?.[path] === undefined && currentStep === 0
35+
const stepMatchesState = currentStep === values?.[plot.id]?.[path]
36+
if (isOnMount || stepMatchesState) {
3437
return
3538
}
3639
setComparisonMultiPlotValue(path, plot.id, currentStep)

0 commit comments

Comments
 (0)