Skip to content

Commit

Permalink
#2135 - add tmp fix for functional groups handling in template tool (#…
Browse files Browse the repository at this point in the history
…2188)

Co-authored-by: Stanislav Permiakov <Stanislav.Permiakov@primark.onmicrosoft.com>
  • Loading branch information
KonstantinEpam23 and Stanislav Permiakov authored Feb 8, 2023
1 parent be19442 commit 2b78a45
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/ketcher-react/src/script/editor/tool/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TemplateTool {

constructor(editor, tmpl) {
this.editor = editor
this.mode = tmpl.mode
this.mode = getTemplateMode(tmpl)
this.editor.selection(null)

this.template = {
Expand Down Expand Up @@ -520,6 +520,13 @@ function addSaltsAndSolventsOnCanvasWithoutMerge(
})
}

function getTemplateMode(tmpl) {
if (tmpl.mode) return tmpl.mode
if (['Functional Groups', 'Salts and Solvents'].includes(tmpl.props?.group))
return 'fg'
return null
}

function getSign(molecule, bond, v) {
const begin = molecule.atoms.get(bond.begin).pp
const end = molecule.atoms.get(bond.end).pp
Expand Down

0 comments on commit 2b78a45

Please sign in to comment.