hook method is not triggering from custom theme library.js
Unsolved
Technical Support
-
Hi i have created a custom theme so that new look and feel. but when a composer is loaded i try to fire a hook method. but that server side hook is not at all calling.
plugin.json
{ "hook": "filter:composer.formatting", "method": "resetComposerFormatting" },
library.js
library.resetComposerFormatting = function (hookData,callback) { if(hookData.options.length>0){ hookData.options = hookData.options.map(e=>{ return e.name != "thumbs"; }); } callback(null,hookData); };
But this method is not at all firing. did i miss anything ?
-
Is your theme activated? Is
library
exported? Is that file executed at all? Try putting console logs in various places. -
@aniinprni you might try renaming it to
index.js
instead. Or set"main": "library.js",
in package.json
Copyright © 2024 NodeBB | Contributors