Skip to content

Commit

Permalink
fixed previous data not showing issue on setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sumn2u committed Jun 21, 2024
1 parent 2a840ed commit 547dd9a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion client/src/SetupPage/index.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useEffect } from "react";
import { styled } from "@mui/material/styles";
import Box from "@mui/material/Box";
import Tabs from "@mui/material/Tabs";
Expand Down Expand Up @@ -52,12 +53,20 @@ const StyledCardContent = styled(CardContent)(({ theme }) => ({

export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotationLab}) => {
const { configuration } = settings;
const [currentTab, setTab] = useState("datatype");
const [currentTab, setTab] = useState(false);
const [hasConfig, setHasConfig] = useState(false);
const settingsConfig = useSettings()
const updateConfiguration = (newConfig) => {
const {labels} = newConfig
setHasConfig(labels.length > 0)
const newSettings = {
...settings,
configuration: {
...settings.configuration,
labels
}
};
settingsConfig.changeSetting('settings',newSettings);
setConfiguration({type: "UPDATE_CONFIGURATION", payload: newConfig})
}
const {t} = useTranslation();
Expand All @@ -79,6 +88,10 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotat
const updateTaskInfo = (newTaskInfo) => {
setConfiguration({type: "UPDATE_TASK_INFO", payload: newTaskInfo})
}

useEffect(() => {
setTab("datatype");
}, []);

const showLab = ()=> {
const hasLabels = configuration.labels.length > 0;
Expand Down

0 comments on commit 547dd9a

Please sign in to comment.