Skip to content

Commit

Permalink
fix: mv SheetClipboardController out of render module
Browse files Browse the repository at this point in the history
  • Loading branch information
lumixraku committed Nov 23, 2024
1 parent c1c347f commit 3723a5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,15 @@ export class SheetClipboardController extends RxDisposable {

if (docSelectionRenderService) {
sheetPasteShortKeyFn(docSelectionRenderService);
} else {
this._renderManagerService.created$.subscribe((renderer) => {
if (renderer.unitId === DOCS_NORMAL_EDITOR_UNIT_ID_KEY) {
docSelectionRenderService = this._renderManagerService.getRenderById(DOCS_NORMAL_EDITOR_UNIT_ID_KEY)?.with(DocSelectionRenderService);
if (docSelectionRenderService) {
sheetPasteShortKeyFn(docSelectionRenderService);
}
}
});
}
this._renderManagerService.created$.subscribe((renderer) => {
if (renderer.unitId === DOCS_NORMAL_EDITOR_UNIT_ID_KEY) {
docSelectionRenderService = this._renderManagerService.getRenderById(DOCS_NORMAL_EDITOR_UNIT_ID_KEY)?.with(DocSelectionRenderService);
if (docSelectionRenderService) {
sheetPasteShortKeyFn(docSelectionRenderService);
}
}
});
}

private _init(): void {
Expand Down
5 changes: 4 additions & 1 deletion packages/sheets-ui/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export class UniverSheetsUIPlugin extends Plugin {
this._initAutoFocus();
}

registerDependencies(this._injector, [
[SheetClipboardController],
]);

this._registerRenderBasics();

touchDependencies(this._injector, [
Expand Down Expand Up @@ -240,7 +244,6 @@ export class UniverSheetsUIPlugin extends Plugin {
[MoveRangeRenderController],

// editor
[SheetClipboardController],
[EditorBridgeRenderController],
[EditingRenderController],

Expand Down

0 comments on commit 3723a5f

Please sign in to comment.