Skip to content

Commit 9cf9170

Browse files
authored
chore: remove now-unneeded cast (#9016)
1 parent 4074cee commit 9cf9170

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

core/contextmenu_registry.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ export namespace ContextMenuRegistry {
155155
block?: BlockSvg;
156156
workspace?: WorkspaceSvg;
157157
comment?: RenderedWorkspaceComment;
158-
// TODO(#8839): Remove any once Block, etc. implement IFocusableNode
159-
focusedNode?: IFocusableNode | any;
158+
focusedNode?: IFocusableNode;
160159
}
161160

162161
/**

core/shortcut_registry.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,18 +253,19 @@ export class ShortcutRegistry {
253253
!shortcut ||
254254
(shortcut.preconditionFn &&
255255
!shortcut.preconditionFn(workspace, {
256-
focusedNode: getFocusManager().getFocusedNode(),
256+
focusedNode: getFocusManager().getFocusedNode() ?? undefined,
257257
}))
258258
) {
259259
continue;
260260
}
261261
// If the key has been handled, stop processing shortcuts.
262262
if (
263263
shortcut.callback?.(workspace, e, shortcut, {
264-
focusedNode: getFocusManager().getFocusedNode(),
264+
focusedNode: getFocusManager().getFocusedNode() ?? undefined,
265265
})
266-
)
266+
) {
267267
return true;
268+
}
268269
}
269270
return false;
270271
}

0 commit comments

Comments
 (0)