File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
webview/src/plots/components/comparisonTable Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 11import {
2+ ComparisonPlots ,
23 ComparisonRevision ,
34 PlotsComparisonData
45} from 'dvc/src/plots/webview/contract'
@@ -26,6 +27,7 @@ export const ComparisonTable: React.FC<ComparisonTableProps> = ({
2627} ) => {
2728 const pinnedColumn = useRef ( currentPinnedColumn || '' )
2829 const [ columns , setColumns ] = useState < ComparisonTableColumn [ ] > ( [ ] )
30+ const [ comparisonPlots , setComparisonPlots ] = useState < ComparisonPlots > ( [ ] )
2931
3032 const isPinned = ( column : ComparisonTableColumn ) : boolean =>
3133 column . revision === pinnedColumn . current
@@ -54,6 +56,8 @@ export const ComparisonTable: React.FC<ComparisonTableProps> = ({
5456 [ revisions , getPinnedColumnRevision ]
5557 )
5658
59+ useEffect ( ( ) => setComparisonPlots ( plots ) , [ plots ] )
60+
5761 const setColumnsOrder = ( order : string [ ] ) => {
5862 const newOrder = reorderObjectList < ComparisonRevision > (
5963 order ,
@@ -91,7 +95,7 @@ export const ComparisonTable: React.FC<ComparisonTableProps> = ({
9195 setColumnsOrder = { setColumnsOrder }
9296 setPinnedColumn = { changePinnedColumn }
9397 />
94- { plots . map ( ( { path, revisions : revs } ) => (
98+ { comparisonPlots . map ( ( { path, revisions : revs } ) => (
9599 < ComparisonTableRow
96100 key = { path }
97101 path = { path }
You can’t perform that action at this time.
0 commit comments