Skip to content

Commit

Permalink
#2033 - one more place to restore saved selection tool
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSPb89 committed Jan 25, 2023
1 parent 5f7bbf1 commit 83ae3f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ketcher-react/src/script/ui/state/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
import { supportedSGroupTypes } from './constants'
import { setAnalyzingFile } from './request'
import tools from '../action/tools'
import { SettingsManager } from '../utils/settingsManager'

export function onAction(action) {
if (action && action.dialog) {
Expand Down Expand Up @@ -142,9 +143,10 @@ export function load(struct: Struct, options?) {

if (fragment) {
if (parsedStruct.isBlank()) {
const savedSelectedTool = SettingsManager.selectionTool
dispatch({
type: 'ACTION',
action: tools['select-rectangle'].action
action: savedSelectedTool || tools['select-rectangle'].action
})
} else {
dispatch(onAction({ tool: 'paste', opts: parsedStruct }))
Expand Down

0 comments on commit 83ae3f3

Please sign in to comment.