fix(frontend): unbreak dashboard — bundle order, IIFE close, dup const
Three merge-fallout bugs that combined to leave the services grid empty
and most UI inert:
1. error-handler.js was bundled into onboarding.js (loaded 3rd), but
globals.js in core.js (loaded 1st) does `const errorHandler = new
ErrorHandler()` at top level. ErrorHandler was undefined when core.js
ran -> ReferenceError -> globals.js stopped, so window.APPS,
_showTotpOverlay, loadServices, etc. were never set, and init.js
blew up on every call into core's exports.
Moved error-handler.js to the start of the core.js bundle so the
class is on window before any other script touches it.
2. setup-wizard.js also declared `const errorHandler = new ErrorHandler()`
at top level. Classic scripts share the document's top-level lexical
environment, so this collided with globals.js's declaration ->
redeclaration SyntaxError in features.js. Removed setup-wizard.js's
copy; it picks up the global one.
3. tooltip-definitions.js closed its `(function(window){...})(window);`
IIFE at line ~171 ("Validation module loaded"), then the TOOLTIP_
DEFINITIONS array, getter helpers, window.TooltipDefinitions export,
and final `debug(...)` log all sat at top level — outside the IIFE,
where `debug` was no longer in scope. Removed the early close and
added one at EOF so the whole file is in one IIFE.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// Shared timezone utility — used by setup wizard and settings modal
|
||||
const errorHandler = new ErrorHandler();
|
||||
// errorHandler is declared globally in globals.js (core.js bundle); reusing it
|
||||
// here so we don't get "redeclaration of const errorHandler" at script scope.
|
||||
|
||||
window.populateTimezoneSelect = function(selectEl, selectedTz) {
|
||||
const timezones = Intl.supportedValuesOf('timeZone');
|
||||
|
||||
Reference in New Issue
Block a user