Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2113 Hovered structure gets into the saved molecule #2119

Merged
merged 5 commits into from
Mar 22, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 effectedTools = ['paste', 'template']
if (effectedTools.includes(actionTool.tool) && group?.includes('save')) {
const savedSelectedTool = SettingsManager.selectionTool
dispatch({
type: 'ACTION',
Expand Down Expand Up @@ -86,7 +86,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