Skip to content

Commit

Permalink
Merge branch 'stagingcandidate' of https://github.com/m2ms/fragalysis…
Browse files Browse the repository at this point in the history
…-frontend into stagingcandidate
  • Loading branch information
boriskovar-m2ms committed May 29, 2024
2 parents c6557a0 + 7898467 commit c7f0864
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/components/preview/tags/modal/editTagsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const useStyles = makeStyles(theme => ({
}
}));

const NEW_TAG = { id: -1, tag: '-- new tag --' };
const NEW_TAG = { id: -1, tag: '-- new tag --', category: DEFAULT_CATEGORY, colour: DEFAULT_TAG_COLOR };

export const EditTagsModal = ({ open, anchorEl, setOpenDialog }) => {
const classes = useStyles();
Expand Down Expand Up @@ -79,7 +79,9 @@ export const EditTagsModal = ({ open, anchorEl, setOpenDialog }) => {

useEffect(() => {
if (tag) {
setNewTagCategory(tag.category);
if (tag.category) {
setNewTagCategory(tag.category);
}
if (tag.colour) {
setNewTagColor(tag.colour);
} else {
Expand Down Expand Up @@ -123,7 +125,7 @@ export const EditTagsModal = ({ open, anchorEl, setOpenDialog }) => {
}, [allMolList, tag]);

const resetTagToEditState = () => {
setNewTagCategory(1);
setNewTagCategory(DEFAULT_CATEGORY);
setNewTagColor(DEFAULT_TAG_COLOR);
setNewTagName('');
setNewTagLink('');
Expand Down

0 comments on commit c7f0864

Please sign in to comment.