diff --git a/app/assets/javascripts/discourse/app/lib/plugin-api.js b/app/assets/javascripts/discourse/app/lib/plugin-api.js index 9635da273a7..3fa4fcf1974 100644 --- a/app/assets/javascripts/discourse/app/lib/plugin-api.js +++ b/app/assets/javascripts/discourse/app/lib/plugin-api.js @@ -1223,11 +1223,14 @@ class PluginApi { /** * Registers a "beforeSave" function on the composer. This allows you to * implement custom logic that will happen before the user makes a post. + * The passed function is expected to return a promise. * * Example: * * api.composerBeforeSave(() => { - * console.log("Before saving, do something!"); + * return new Promise(() => { + * console.log("Before saving, do something!") + * }) * }) */ composerBeforeSave(method) {