Skip to content

Commit

Permalink
feat(verify component): disable species creation (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mloweedgar authored Oct 23, 2021
1 parent 5e91f68 commit 88c135b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
1 change: 0 additions & 1 deletion src/components/Species.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function Species(props) {
speciesContext.onChange(value || '');
}}
className={props.classes.root}
freeSolo={true}
inputValue={speciesContext.speciesInput}
renderInput={(params) => (
<TextField {...params} placeholder="e.g. Mango" variant="outlined" />
Expand Down
23 changes: 0 additions & 23 deletions src/components/Verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,29 +246,6 @@ const Verify = (props) => {
window.alert('Please select one or more captures');
return;
}
/*
* check species
*/
const isNew = await speciesContext.isNewSpecies();
if (isNew) {
const answer = await new Promise((resolve) => {
if (
window.confirm(
`The species ${speciesContext.speciesInput} is a new one, create it?`,
)
) {
resolve(true);
} else {
resolve(false);
}
});
if (!answer) {
return;
} else {
//create new species
await speciesContext.createSpecies();
}
}
const speciesId = await speciesContext.getSpeciesId();
if (speciesId) {
approveAction.speciesId = speciesId;
Expand Down

0 comments on commit 88c135b

Please sign in to comment.