Skip to content

Commit

Permalink
new project modal state set as closed to avoid fluttering in & out (#286
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kafkasl authored May 28, 2021
1 parent aa4ca95 commit e52d7ed
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/pages/data-management/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const DataManagementPage = ({ route }) => {
const {
saving: sampleSaving,
} = useSelector((state) => state.samples.meta);
const [newProjectModalVisible, setNewProjectModalVisible] = useState(true);
const [newProjectModalVisible, setNewProjectModalVisible] = useState(false);
const experiments = useSelector((state) => state.experiments);
const activeProjectUuid = useSelector((state) => state.projects.meta.activeProjectUuid);
const { activeProjectUuid, loading: projectsLoading } = useSelector((state) => state.projects.meta);
const activeProject = projectsList[activeProjectUuid];

const existingExperiments = activeProject?.experiments
Expand All @@ -54,10 +54,15 @@ const DataManagementPage = ({ route }) => {
}, [activeProject]);

useEffect(() => {
if (projectsList.ids.length) {
if (projectsLoading === true) {
return;
}
if (projectsList.ids.length === 0) {
setNewProjectModalVisible(true);
} else {
setNewProjectModalVisible(false);
}
}, [projectsList]);
}, [projectsList, projectsLoading]);

const unnamedExperimentName = 'Unnamed Analysis';

Expand Down

0 comments on commit e52d7ed

Please sign in to comment.