Templates 2.0 (#636)
Templates 2.0 and a whole bunch of other refactoring
This commit is contained in:
@@ -115,18 +115,10 @@ export class SlashCommandHook implements Hook<SlashCommandHookT> {
|
||||
});
|
||||
// Replace with whatever the completion is
|
||||
safeRun(async () => {
|
||||
const [plugName, functionName] = slashCompletion.invoke.split(
|
||||
".",
|
||||
await this.editor.system.system.invokeFunction(
|
||||
slashCompletion.invoke,
|
||||
[slashCompletion],
|
||||
);
|
||||
const plug = this.editor.system.system.loadedPlugs.get(plugName);
|
||||
if (!plug) {
|
||||
this.editor.flashNotification(
|
||||
`Plug ${plugName} not found`,
|
||||
"error",
|
||||
);
|
||||
return;
|
||||
}
|
||||
await plug.invoke(functionName, [slashCompletion]);
|
||||
this.editor.focus();
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user