Skip to content

Commit

Permalink
fix: fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
wzhudev committed Jun 18, 2024
1 parent 721f501 commit 068245e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/docs/src/commands/commands/delete.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const DeleteLeftCommand: ICommand = {
const docSkeletonManagerService = getCommandSkeleton(accessor, unitId);
const activeRange = textSelectionManagerService.getActiveRange();
const ranges = textSelectionManagerService.getSelections();
const skeleton = docSkeletonManagerService?.getSkeleton()?.skeleton;
const skeleton = docSkeletonManagerService?.getSkeleton();
if (activeRange == null || skeleton == null || ranges == null) {
return false;
}
Expand Down Expand Up @@ -202,7 +202,7 @@ export const DeleteRightCommand: ICommand = {

const activeRange = textSelectionManagerService.getActiveRange();
const ranges = textSelectionManagerService.getSelections();
const skeleton = docSkeletonManagerService?.getSkeleton()?.skeleton;
const skeleton = docSkeletonManagerService?.getSkeleton();
if (activeRange == null || skeleton == null || ranges == null) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/controllers/move-cursor.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class MoveCursorController extends Disposable {
}

const skeleton = this._renderManagerService.getRenderById(docDataModel.getUnitId())
?.with(DocSkeletonManagerService).getSkeleton()?.skeleton;
?.with(DocSkeletonManagerService).getSkeleton();
const docObject = this._getDocObject();

if (activeRange == null || skeleton == null || docObject == null) {
Expand Down Expand Up @@ -203,7 +203,7 @@ export class MoveCursorController extends Disposable {
}

const skeleton = this._renderManagerService.getRenderById(docDataModel.getUnitId())
?.with(DocSkeletonManagerService).getSkeleton()?.skeleton;
?.with(DocSkeletonManagerService).getSkeleton();
const docObject = this._getDocObject();

if (activeRange == null || skeleton == null || docObject == null || allRanges == null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/controllers/normal-input.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class NormalInputController extends Disposable {
const e = event as InputEvent;

const skeleton = this._renderManagerService.getRenderById(documentModel.getUnitId())
?.with(DocSkeletonManagerService).getSkeleton()?.skeleton;
?.with(DocSkeletonManagerService).getSkeleton();

if (e.data == null || skeleton == null) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export interface IRenderManagerService extends IDisposable {
/** @deprecated */
createRender$: Observable<string>;
/** @deprecated this design is very very weird! Remove it. */
create(unitId: Nullable<string>): void;
create(unitId: string): void;

/** @deprecated There will be multi units to render at the same time, so there is no *current*. */
getCurrent(): Nullable<IRender>;
Expand Down Expand Up @@ -127,7 +127,7 @@ export class RenderManagerService extends Disposable implements IRenderManagerSe
return Array.from(this._renderControllers.get(type) ?? []);
}

create(unitId: Nullable<string>) {
create(unitId: string) {
this._createRender$.next(unitId);
}

Expand Down

0 comments on commit 068245e

Please sign in to comment.