Skip to content

Commit

Permalink
#2113 - added remove-not-rendered-struct action
Browse files Browse the repository at this point in the history
  • Loading branch information
VandaEPAM committed Apr 28, 2023
1 parent 10531ae commit 64dcb2d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
14 changes: 14 additions & 0 deletions packages/ketcher-react/src/script/ui/action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,20 @@ const config = {
},
hidden: (options) => isHidden(options, 'any-atom')
},
// Removing from what should be saved - structure, which was added to paste tool,
// but not yet rendered on canvas
'remove-not-rendered-struct': {
action: {
thunk: (dispatch) => {
const savedSelectedTool = SettingsManager.selectionTool

dispatch({
type: 'ACTION',
action: savedSelectedTool || tools['select-rectangle'].action
})
}
}
},
...server,
...debug,
...tools,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ const mapDispatchToProps = (dispatch: Dispatch) => {
return {
onClear: () => dispatchAction('clear'),
onFileOpen: () => dispatchAction('open'),
onSave: () => dispatchAction('save'),
onSave: () => {
dispatchAction('remove-not-rendered-struct')
dispatchAction('save')
},
onUndo: () => dispatchAction('undo'),
onRedo: () => dispatchAction('redo'),
onCopy: () => dispatchAction('copy'),
Expand Down

0 comments on commit 64dcb2d

Please sign in to comment.