fix: satisfy editor find command contract
This commit is contained in:
@@ -17,6 +17,8 @@ interface EditorFindCommandConfig {
|
||||
searchEnabled: boolean
|
||||
}
|
||||
|
||||
const noop = () => {}
|
||||
|
||||
function canSearchCurrentNote(config: EditorFindCommandsConfig): boolean {
|
||||
const activeFileKind = config.activeFileKind ?? 'markdown'
|
||||
return config.hasActiveNote && activeFileKind !== 'binary'
|
||||
@@ -30,7 +32,7 @@ function createEditorFindCommand(config: EditorFindCommandConfig): CommandAction
|
||||
shortcut: config.shortcut,
|
||||
keywords: config.keywords,
|
||||
enabled: config.searchEnabled && !!config.execute,
|
||||
execute: config.execute,
|
||||
execute: config.execute ?? noop,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user