Skip to content

Commit

Permalink
#5209 - Cancel of Edit Connection points dialog cause existed connect…
Browse files Browse the repository at this point in the history
…ion points eliminated
  • Loading branch information
rrodionov91 committed Sep 10, 2024
1 parent 589624b commit 0bb0b21
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,18 @@ const MonomerConnection = ({
const [modalExpanded, setModalExpanded] = useState(false);

const cancelBondCreationAndClose = () => {
editor.events.cancelBondCreationViaModal.dispatch(secondMonomer);
onClose();
if (isReconnectionDialog) {
polymerBond.firstMonomer.attachmentPointsToBonds[
initialFirstMonomerAttachmentPointRef.current
] = polymerBond;
polymerBond.secondMonomer.attachmentPointsToBonds[
initialSecondMonomerAttachmentPointRef.current
] = polymerBond;
onClose();
} else {
editor.events.cancelBondCreationViaModal.dispatch(secondMonomer);
onClose();
}
};

const connectMonomers = () => {
Expand Down

0 comments on commit 0bb0b21

Please sign in to comment.