Skip to content

Commit

Permalink
fixed edit modal appearing at wrong time
Browse files Browse the repository at this point in the history
  • Loading branch information
BrittExe committed Nov 18, 2024
1 parent 40719c5 commit cc5b3d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions frontend/src/components/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ export const UpdateSpeciesModal: React.FC<UpdateSpeciesModalProps> = ({
}
};

console.log("open status");
console.log(open);
return (
<Modal
open={open}
Expand Down
10 changes: 2 additions & 8 deletions frontend/src/components/RenderSpeciesReactionTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,9 @@ const RenderSpeciesReactionTable: React.FC<Props> = ({ selectedFamilyID, selecte
//console.log(error);
} finally{
setEditPropertiesLoading(false);
}
handleEditPropertiesOpen();
};
// wait till ready to open edit modal
useEffect(() => {
if (editPropertiesLoading === false) {
handleEditPropertiesOpen();
}
}, [editPropertiesLoading]);
};

const handleReactionCellClick = (params: GridRowParams<Reaction>) => {
const reaction = params.row;
Expand Down Expand Up @@ -175,7 +169,7 @@ const RenderSpeciesReactionTable: React.FC<Props> = ({ selectedFamilyID, selecte
flex: 1,
renderCell: (params) => (
<Typography variant="body1">
{params.row.property.weight === 0 ? '' : (params.row.property.weight ?? 'N/A')}
{params.row.property.weight === 0 ? '' : (params.row.property.weight ?? '')}
</Typography>
),
},
Expand Down

0 comments on commit cc5b3d0

Please sign in to comment.