From faf596037395deb3bdf9fd09edae0c099845aa79 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 27 Jan 2021 12:08:25 -0500 Subject: [PATCH] fix: bug where `action:ajaxify.end` was never called if there were no init scripts --- public/src/ajaxify.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 1de05c9e49..d38bab6d71 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -342,6 +342,10 @@ ajaxify = window.ajaxify || {}; // Require and parse modules var outstanding = data.scripts.length; + if (!outstanding) { + return callback(); + } + if (outstanding && !app.flags.actionScriptLoadDeprecation) { console.group('Deprecation Notice'); console.warn('The "action:script.load" event has been deprecated and will be removed in NodeBB v1.18.0. Please attach a listener to the "static:script.init" client-side hook instead');