chore: remove now-unneeded cast (#9016)

This commit is contained in:
Maribeth Moffatt
2025-05-09 16:20:36 -07:00
committed by GitHub
parent 4074cee31b
commit 9cf9170815
2 changed files with 5 additions and 5 deletions

View File

@@ -155,8 +155,7 @@ export namespace ContextMenuRegistry {
block?: BlockSvg;
workspace?: WorkspaceSvg;
comment?: RenderedWorkspaceComment;
// TODO(#8839): Remove any once Block, etc. implement IFocusableNode
focusedNode?: IFocusableNode | any;
focusedNode?: IFocusableNode;
}
/**

View File

@@ -253,7 +253,7 @@ export class ShortcutRegistry {
!shortcut ||
(shortcut.preconditionFn &&
!shortcut.preconditionFn(workspace, {
focusedNode: getFocusManager().getFocusedNode(),
focusedNode: getFocusManager().getFocusedNode() ?? undefined,
}))
) {
continue;
@@ -261,10 +261,11 @@ export class ShortcutRegistry {
// If the key has been handled, stop processing shortcuts.
if (
shortcut.callback?.(workspace, e, shortcut, {
focusedNode: getFocusManager().getFocusedNode(),
focusedNode: getFocusManager().getFocusedNode() ?? undefined,
})
)
) {
return true;
}
}
return false;
}