DEV: Correct decorateWidget error checking logic (#24036)

`name` referred to `window.name`, so the mistake wasn't detected by eslint 🤦‍♂️
This commit is contained in:
David Taylor
2023-10-20 15:56:54 +01:00
committed by GitHub
parent 373b2ca362
commit 6c6740bb19

View File

@@ -41,11 +41,11 @@ export function deleteFromRegistry(name) {
const _decorators = {};
export function decorateWidget(widgetName, cb) {
if (!_registry[name]) {
if (!_registry[widgetName]) {
// eslint-disable-next-line no-console
console.error(
consolePrefix(),
`decorateWidget: Could not find widget '${name}' in registry`
`decorateWidget: Could not find widget '${widgetName}' in registry`
);
}
_decorators[widgetName] ??= [];