mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 10:34:02 +00:00
fix: Optimize the initialization method for masterPaneController (#2333)
This commit is contained in:
parent
2bbb4099e3
commit
14390f000d
@ -18,7 +18,9 @@ export function OutlinePaneContext(props: {
|
|||||||
hideFilter?: boolean;
|
hideFilter?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const treeMaster = props.treeMaster || new TreeMaster(props.pluginContext, props.options);
|
const treeMaster = props.treeMaster || new TreeMaster(props.pluginContext, props.options);
|
||||||
const [masterPaneController, setMasterPaneController] = useState(new PaneController(props.paneName || MasterPaneName, treeMaster));
|
const [masterPaneController, setMasterPaneController] = useState(
|
||||||
|
() => new PaneController(props.paneName || MasterPaneName, treeMaster),
|
||||||
|
);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return treeMaster.onPluginContextChange(() => {
|
return treeMaster.onPluginContextChange(() => {
|
||||||
setMasterPaneController(new PaneController(props.paneName || MasterPaneName, treeMaster));
|
setMasterPaneController(new PaneController(props.paneName || MasterPaneName, treeMaster));
|
||||||
@ -40,7 +42,9 @@ export const OutlinePlugin = (ctx: IPublicModelPluginContext, options: any) => {
|
|||||||
const { skeleton, config, canvas, project } = ctx;
|
const { skeleton, config, canvas, project } = ctx;
|
||||||
|
|
||||||
let isInFloatArea = true;
|
let isInFloatArea = true;
|
||||||
const hasPreferenceForOutline = config.getPreference().contains('outline-pane-pinned-status-isFloat', 'skeleton');
|
const hasPreferenceForOutline = config
|
||||||
|
.getPreference()
|
||||||
|
.contains('outline-pane-pinned-status-isFloat', 'skeleton');
|
||||||
if (hasPreferenceForOutline) {
|
if (hasPreferenceForOutline) {
|
||||||
isInFloatArea = config.getPreference().get('outline-pane-pinned-status-isFloat', 'skeleton');
|
isInFloatArea = config.getPreference().get('outline-pane-pinned-status-isFloat', 'skeleton');
|
||||||
}
|
}
|
||||||
@ -160,4 +164,4 @@ OutlinePlugin.meta = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
OutlinePlugin.pluginName = 'OutlinePlugin';
|
OutlinePlugin.pluginName = 'OutlinePlugin';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user