You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-27 23:28:38 +02:00
Plugins: Allow custom commands to return a result
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import CommandService, { CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
|
||||
import CommandService, { CommandContext, CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
|
||||
import { Command } from './types';
|
||||
|
||||
/**
|
||||
@ -62,7 +62,9 @@ export default class JoplinCommands {
|
||||
if ('iconName' in command) declaration.iconName = command.iconName;
|
||||
|
||||
const runtime:CommandRuntime = {
|
||||
execute: command.execute,
|
||||
execute: (_context:CommandContext, ...args:any[]) => {
|
||||
return command.execute(...args);
|
||||
},
|
||||
};
|
||||
|
||||
if ('enabledCondition' in command) runtime.enabledCondition = command.enabledCondition;
|
||||
|
Reference in New Issue
Block a user