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 9, 2024
1 parent 2b64668 commit 88cd64f
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 88cd64f

Please sign in to comment.