1
+ import { useEffect } from "react" ;
1
2
import { styled } from "@mui/material/styles" ;
2
3
import Box from "@mui/material/Box" ;
3
4
import Tabs from "@mui/material/Tabs" ;
@@ -52,12 +53,20 @@ const StyledCardContent = styled(CardContent)(({ theme }) => ({
52
53
53
54
export const SetupPage = ( { setConfiguration, settings, setShowLabel, showAnnotationLab} ) => {
54
55
const { configuration } = settings ;
55
- const [ currentTab , setTab ] = useState ( "datatype" ) ;
56
+ const [ currentTab , setTab ] = useState ( false ) ;
56
57
const [ hasConfig , setHasConfig ] = useState ( false ) ;
57
58
const settingsConfig = useSettings ( )
58
59
const updateConfiguration = ( newConfig ) => {
59
60
const { labels} = newConfig
60
61
setHasConfig ( labels . length > 0 )
62
+ const newSettings = {
63
+ ...settings ,
64
+ configuration : {
65
+ ...settings . configuration ,
66
+ labels
67
+ }
68
+ } ;
69
+ settingsConfig . changeSetting ( 'settings' , newSettings ) ;
61
70
setConfiguration ( { type : "UPDATE_CONFIGURATION" , payload : newConfig } )
62
71
}
63
72
const { t} = useTranslation ( ) ;
@@ -79,6 +88,10 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotat
79
88
const updateTaskInfo = ( newTaskInfo ) => {
80
89
setConfiguration ( { type : "UPDATE_TASK_INFO" , payload : newTaskInfo } )
81
90
}
91
+
92
+ useEffect ( ( ) => {
93
+ setTab ( "datatype" ) ;
94
+ } , [ ] ) ;
82
95
83
96
const showLab = ( ) => {
84
97
const hasLabels = configuration . labels . length > 0 ;
0 commit comments