diff --git a/webview/src/setup/components/dvc/Dvc.tsx b/webview/src/setup/components/dvc/Dvc.tsx index ae7dedf41e..d003cd128d 100644 --- a/webview/src/setup/components/dvc/Dvc.tsx +++ b/webview/src/setup/components/dvc/Dvc.tsx @@ -7,8 +7,8 @@ import { ProjectUninitialized } from './ProjectUninitialized' import { CliUnavailable } from './CliUnavailable' import { EmptyState } from '../../../shared/components/emptyState/EmptyState' import { usePrevious } from '../../hooks/usePrevious' -import { updateSectionCollapsed } from '../../state/webviewSlice' import { SetupState } from '../../store' +import { closeSection } from '../shared/util' export const Dvc: React.FC = () => { const dispatch = useDispatch() @@ -29,14 +29,7 @@ export const Dvc: React.FC = () => { } if (previousIsComplete === false && isComplete) { - dispatch( - updateSectionCollapsed({ - [SetupSection.DVC]: true, - [SetupSection.EXPERIMENTS]: false, - [SetupSection.REMOTES]: false, - [SetupSection.STUDIO]: false - }) - ) + dispatch(closeSection(SetupSection.DVC)) } }, [ dispatch, diff --git a/webview/src/setup/components/shared/FocusDvcSection.tsx b/webview/src/setup/components/shared/FocusDvcSection.tsx index e5c0eceed5..f445ec99fe 100644 --- a/webview/src/setup/components/shared/FocusDvcSection.tsx +++ b/webview/src/setup/components/shared/FocusDvcSection.tsx @@ -1,7 +1,7 @@ import React from 'react' import { useDispatch } from 'react-redux' import { SetupSection } from 'dvc/src/setup/webview/contract' -import { updateSectionCollapsed } from '../../state/webviewSlice' +import { focusSection } from './util' import { Button } from '../../../shared/components/button/Button' export const FocusDvcSection = () => { @@ -9,16 +9,7 @@ export const FocusDvcSection = () => { return (