Skip to content

Commit 547dd9a

Browse files
committed
fixed previous data not showing issue on setup
1 parent 2a840ed commit 547dd9a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

client/src/SetupPage/index.jsx

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useEffect } from "react";
12
import { styled } from "@mui/material/styles";
23
import Box from "@mui/material/Box";
34
import Tabs from "@mui/material/Tabs";
@@ -52,12 +53,20 @@ const StyledCardContent = styled(CardContent)(({ theme }) => ({
5253

5354
export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotationLab}) => {
5455
const { configuration } = settings;
55-
const [currentTab, setTab] = useState("datatype");
56+
const [currentTab, setTab] = useState(false);
5657
const [hasConfig, setHasConfig] = useState(false);
5758
const settingsConfig = useSettings()
5859
const updateConfiguration = (newConfig) => {
5960
const {labels} = newConfig
6061
setHasConfig(labels.length > 0)
62+
const newSettings = {
63+
...settings,
64+
configuration: {
65+
...settings.configuration,
66+
labels
67+
}
68+
};
69+
settingsConfig.changeSetting('settings',newSettings);
6170
setConfiguration({type: "UPDATE_CONFIGURATION", payload: newConfig})
6271
}
6372
const {t} = useTranslation();
@@ -79,6 +88,10 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotat
7988
const updateTaskInfo = (newTaskInfo) => {
8089
setConfiguration({type: "UPDATE_TASK_INFO", payload: newTaskInfo})
8190
}
91+
92+
useEffect(() => {
93+
setTab("datatype");
94+
}, []);
8295

8396
const showLab = ()=> {
8497
const hasLabels = configuration.labels.length > 0;

0 commit comments

Comments
 (0)