File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,21 @@ import { NodePath } from './components/NodePath'
1818import { Empty } from 'antd'
1919import cls from 'classnames'
2020import './styles.less'
21+ import { useWorkbench } from 'packages/react/lib'
2122
2223const GlobalState = {
2324 idleRequest : null ,
2425}
2526
2627export const SettingsForm : React . FC < ISettingFormProps > = observer (
2728 ( props ) => {
28- const operation = useOperation ( )
29- const node = useCurrentNode ( )
30- const selected = useSelected ( )
29+ const workbench = useWorkbench ( )
30+ const currentWorkspace =
31+ workbench ?. activeWorkspace || workbench ?. currentWorkspace
32+ const currentWorkspaceId = currentWorkspace ?. id
33+ const operation = useOperation ( currentWorkspaceId )
34+ const node = useCurrentNode ( currentWorkspaceId )
35+ const selected = useSelected ( currentWorkspaceId )
3136 const prefix = usePrefix ( 'settings-form' )
3237 const schema = node ?. designerProps ?. propsSchema
3338 const form = useMemo ( ( ) => {
Original file line number Diff line number Diff line change 11import { useSelected } from './useSelected'
22import { useTree } from './useTree'
33
4- export const useCurrentNode = ( ) => {
5- const selected = useSelected ( )
6- const tree = useTree ( )
4+ export const useCurrentNode = ( workspaceId ?: string ) => {
5+ const selected = useSelected ( workspaceId )
6+ const tree = useTree ( workspaceId )
77 return tree ?. findById ?.( selected [ 0 ] )
88}
Original file line number Diff line number Diff line change 11import { useSelection } from './useSelection'
22
3- export const useSelected = ( ) => {
4- const selection = useSelection ( )
3+ export const useSelected = ( workspaceId ?: string ) => {
4+ const selection = useSelection ( workspaceId )
55 return selection ?. selected || [ ]
66}
You can’t perform that action at this time.
0 commit comments