Skip to content

Commit

Permalink
#2113 Hovered structure gets into the saved molecule (#2119)
Browse files Browse the repository at this point in the history
* Fix hovered structure getting into saving

* Fix typo

Co-authored-by: Nikita <Nikita_Vozisov@epam.com>

* Update variable name

---------

Co-authored-by: Nikita <Nikita_Vozisov@epam.com>
  • Loading branch information
yuleicul and Nitvex authored Mar 22, 2023
1 parent 6ab5a3a commit bba4bc9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/ketcher-react/src/script/ui/state/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export function initKeydownListener(element) {
}
}

function removeNotRenderedStruct(actionTool, event, dispatch) {
const { code, metaKey } = event
if (actionTool.tool === 'paste' && code === 'KeyS' && metaKey) {
function removeNotRenderedStruct(actionTool, group, dispatch) {
const affectedTools = ['paste', 'template']
if (affectedTools.includes(actionTool.tool) && group?.includes('save')) {
const savedSelectedTool = SettingsManager.selectionTool
dispatch({
type: 'ACTION',
Expand Down Expand Up @@ -108,7 +108,7 @@ function keyHandle(dispatch, state, hotKeys, event) {
}
// Removing from what should be saved - structure, which was added to paste tool,
// but not yet rendered on canvas
removeNotRenderedStruct(actionTool, event, dispatch)
removeNotRenderedStruct(actionTool, group, dispatch)

if (clipArea.actions.indexOf(actName) === -1) {
let newAction = actions[actName].action
Expand Down

0 comments on commit bba4bc9

Please sign in to comment.