From ffbcb3892074f1423993cc6abbef2e392945f0a3 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 14 Feb 2025 14:01:13 +0000 Subject: [PATCH] Move execution of startup actions after initialisation of the language switcher Fixes #8946 --- core/modules/startup/startup.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js index b971e473b..4013a37ee 100755 --- a/core/modules/startup/startup.js +++ b/core/modules/startup/startup.js @@ -67,14 +67,6 @@ exports.startup = function() { wiki: $tw.wiki, document: $tw.browser ? document : $tw.fakeDocument }); - // Execute any startup actions - $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction"); - if($tw.browser) { - $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction/Browser"); - } - if($tw.node) { - $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction/Node"); - } // Kick off the language manager and switcher $tw.language = new $tw.Language(); $tw.languageSwitcher = new $tw.PluginSwitcher({ @@ -117,6 +109,14 @@ exports.startup = function() { handlerMethod: "handleKeydownEvent" }]); } + // Execute any startup actions + $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction"); + if($tw.browser) { + $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction/Browser"); + } + if($tw.node) { + $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction/Node"); + } // Clear outstanding tiddler store change events to avoid an unnecessary refresh cycle at startup $tw.wiki.clearTiddlerEventQueue(); // Find a working syncadaptor