@quazardous/qdadm 2.17.3 → 2.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/kernel/Kernel.ts +19 -3
package/package.json
CHANGED
package/src/kernel/Kernel.ts
CHANGED
|
@@ -144,10 +144,26 @@ export class Kernel {
|
|
|
144
144
|
const debugModule = new DebugModuleClass(debugModuleOptions)
|
|
145
145
|
options.moduleDefs = options.moduleDefs || []
|
|
146
146
|
options.moduleDefs.push(debugModule)
|
|
147
|
+
|
|
148
|
+
// `enabled: false` now actually disables (#1900 lot D).
|
|
149
|
+
//
|
|
150
|
+
// The component used to be registered whatever `enabled` said, and
|
|
151
|
+
// Kernel forced options.debug = true on top — which DebugModule.enabled()
|
|
152
|
+
// reads as "turn on". A consumer who wrote `debugBar: { enabled: false }`
|
|
153
|
+
// to switch the bar OFF found it running in PRODUCTION, and the only way
|
|
154
|
+
// out was to omit the key entirely.
|
|
155
|
+
//
|
|
156
|
+
// Note this cuts both ways: an app that passed `enabled: false` believing
|
|
157
|
+
// the key inert — including to keep the bar ON, "since it changes
|
|
158
|
+
// nothing" — will now see it disappear. Both readings were possible
|
|
159
|
+
// precisely because the flag did nothing.
|
|
160
|
+
const debugBarEnabled = debugModuleOptions.enabled !== false
|
|
161
|
+
|
|
147
162
|
// Store component for root wrapper
|
|
148
|
-
setQdadmDebugBar(options.debugBar.component || null)
|
|
149
|
-
|
|
150
|
-
|
|
163
|
+
setQdadmDebugBar(debugBarEnabled ? options.debugBar.component || null : null)
|
|
164
|
+
|
|
165
|
+
// Debug mode follows the bar, and only when the bar is actually on.
|
|
166
|
+
if (debugBarEnabled && !options.debug) {
|
|
151
167
|
options.debug = true
|
|
152
168
|
}
|
|
153
169
|
}
|