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;
|
||||
}) {
|
||||
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(() => {
|
||||
return treeMaster.onPluginContextChange(() => {
|
||||
setMasterPaneController(new PaneController(props.paneName || MasterPaneName, treeMaster));
|
||||
@ -40,7 +42,9 @@ export const OutlinePlugin = (ctx: IPublicModelPluginContext, options: any) => {
|
||||
const { skeleton, config, canvas, project } = ctx;
|
||||
|
||||
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) {
|
||||
isInFloatArea = config.getPreference().get('outline-pane-pinned-status-isFloat', 'skeleton');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user