Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(slides): params in getRenderUnitByPageId (#6053)
Roman Sergeev38b7063c6cda
diff --git a/packages/slides-ui/src/components/sidebar/Sidebar.tsx b/packages/slides-ui/src/components/sidebar/Sidebar.tsxindex 46435b92fd..7ccb607466 100644--- a/packages/slides-ui/src/components/sidebar/Sidebar.tsx+++ b/packages/slides-ui/src/components/sidebar/Sidebar.tsx@@ -33,9 +33,14 @@ export default function RectSidebar() {const currentSlide = univerInstanceService.getCurrentUnitForType<SlideDataModel>(UniverInstanceType.UNIVER_SLIDE);const pageId = currentSlide?.getActivePage()?.id;- if (!pageId) return null;+ // see packages/sheets-ui/src/views/permission/permission-dialog/index.tsx@SheetPermissionDialog+ // see packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx@getUnitId+ // const unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE)!.getUnitId();+ const unitId = univerInstanceService.getFocusedUnit()?.getUnitId() || '';++ if (!pageId || !unitId) return null;- const page = canvasView.getRenderUnitByPageId(pageId, pageId);+ const page = canvasView.getRenderUnitByPageId(pageId, unitId);const transformer = page.scene?.getTransformer();if (!transformer) return null;@@ -47,11 +52,6 @@ export default function RectSidebar() {return null;}- // see packages/sheets-ui/src/views/permission/permission-dialog/index.tsx@SheetPermissionDialog- // see packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx@getUnitId- // const unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE)!.getUnitId();- const unitId = univerInstanceService.getFocusedUnit()?.getUnitId() || '';-return (<section className="univer-p-2 univer-text-center univer-text-sm"><ArrangePanel pageId={pageId} unitId={unitId} />