Skip to content

Commit

Permalink
Backmerge: #5665 – Show remove abbreviation dialog when trying to era…
Browse files Browse the repository at this point in the history
…se expanded monomer
  • Loading branch information
svvald committed Oct 21, 2024
1 parent 169f10c commit e2e2d17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/ketcher-react/src/script/editor/tool/eraser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
IMAGE_KEY,
MULTITAIL_ARROW_KEY,
fromMultitailArrowDeletion,
MonomerMicromolecule,
} from 'ketcher-core';

import LassoHelper from './helper/lasso';
Expand Down Expand Up @@ -359,7 +360,10 @@ class EraserTool implements Tool {
} else if (ci.map === 'sgroups' || ci.map === 'sgroupData') {
const sGroup = sgroups.get(ci.id);

if (FunctionalGroup.isFunctionalGroup(sGroup?.item)) {
if (
FunctionalGroup.isFunctionalGroup(sGroup?.item) ||
sGroup?.item instanceof MonomerMicromolecule
) {
this.editor.event.removeFG.dispatch({ fgIds: [ci.id] });
} else {
this.editor.update(fromSgroupDeletion(restruct, ci.id));
Expand Down

0 comments on commit e2e2d17

Please sign in to comment.