Skip to content

Commit

Permalink
#3251 - updated edit and dublicate logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Gayane Chilingaryan committed Oct 13, 2023
1 parent 15dbccf commit 7875be1
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,20 @@ export const RnaEditor = () => {
};

const cancelEdit = () => {
if (presets.length === 0) {
if (presets.length === 0 || !activePreset.presetInList) {
dispatch(createNewPreset());
return;
} else {
dispatch(setActivePreset(activePreset.presetInList));
}

if (!activePreset.presetInList) {
if (
!activePreset.presetInList &&
activeMonomerGroup !== RnaBuilderPresetsItem.Presets
) {
dispatch(setActiveRnaBuilderItem(RnaBuilderPresetsItem.Presets));
dispatch(setActivePreset(presets[0]));
}

setIsEditMode(false);
};

Expand Down

0 comments on commit 7875be1

Please sign in to comment.