Skip to content

Commit

Permalink
Kontrola existence vytvářeného vztahu nefunguje korektně #538
Browse files Browse the repository at this point in the history
  • Loading branch information
bindeali committed Sep 3, 2024
1 parent ab1cdc0 commit 53ecb73
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/components/modals/NewElemForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,23 @@ export const NewElemForm: React.FC<Props> = (props) => {
const pkg = Object.keys(WorkspaceVocabularies).find(
(pkg) => pkg === event.currentTarget.value
);
if (pkg && props.setSelectedVocabulary) props.setSelectedVocabulary(pkg);
else
if (pkg && props.setSelectedVocabulary) {
props.setSelectedVocabulary(pkg);
props.setErrorText(
checkNames(
WorkspaceVocabularies[event.currentTarget.value].glossary,
props.termName
)
);
} else {
console.error(`Vocabulary ${pkg} not found within the vocabulary list.`);
props.setErrorText(
checkNames(
WorkspaceVocabularies[props.selectedVocabulary].glossary,
props.termName
)
);
props.setErrorText(
checkNames(
WorkspaceVocabularies[props.selectedVocabulary].glossary,
props.termName
)
);
}
};

return (
Expand Down

0 comments on commit 53ecb73

Please sign in to comment.