Skip to content

Commit

Permalink
Fix loading logic of "new project" dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellp authored May 25, 2021
1 parent 5d71b02 commit 43a9acf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/data-management/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ const DataManagementPage = ({ route }) => {
const projectsList = useSelector(((state) => state.projects));
const {
saving: projectSaving,
loading: projectLoading,
error: projectError,
} = projectsList.meta;
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 activeProject = projectsList[activeProjectUuid];
Expand All @@ -45,8 +47,8 @@ const DataManagementPage = ({ route }) => {
}, [activeProject]);

useEffect(() => {
if (projectsList.ids.length) {
setNewProjectModalVisible(false);
if (!projectLoading.loading && !projectError.error && !projectsList.ids.length) {
setNewProjectModalVisible(true);
}
}, [projectsList]);

Expand Down

0 comments on commit 43a9acf

Please sign in to comment.