mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
fix: bug where fallback window trigger was not firing if there were no hook listeners attached
... so in essence the backwards compatibility was not working at all. closes nodebb/nodebb-plugin-composer-default#147
This commit is contained in:
@@ -63,12 +63,10 @@ define('hooks', [], () => {
|
||||
};
|
||||
|
||||
const _fireActionHook = (hookName, data) => {
|
||||
if (!Hooks.hasListeners(hookName)) {
|
||||
return;
|
||||
if (Hooks.hasListeners(hookName)) {
|
||||
Hooks.loaded[hookName].forEach(listener => listener(data));
|
||||
}
|
||||
|
||||
Hooks.loaded[hookName].forEach(listener => listener(data));
|
||||
|
||||
// Backwards compatibility (remove this when we eventually remove jQuery from NodeBB core)
|
||||
$(window).trigger(hookName, data);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user