updated registration logic to be consise
This commit is contained in:
@@ -8,7 +8,7 @@ class ChildRegistrationUtils {
|
||||
async registerChild(child, positionVsParent) {
|
||||
const { softwareType } = child.config.functionality;
|
||||
const { name, id } = child.config.general;
|
||||
|
||||
|
||||
this.logger.debug(`Registering child: ${name} (${id}) as ${softwareType} at ${positionVsParent}`);
|
||||
|
||||
// Enhanced child setup
|
||||
@@ -33,9 +33,9 @@ class ChildRegistrationUtils {
|
||||
registeredAt: Date.now()
|
||||
});
|
||||
|
||||
// IMPORTANT: Only call parent registration - no automatic handling
|
||||
if (typeof this.mainClass.registerOnChildEvents === 'function') {
|
||||
this.mainClass.registerOnChildEvents();
|
||||
// IMPORTANT: Only call parent registration - no automatic handling and if parent has this function then try to register this child
|
||||
if (typeof this.mainClass.registerChild === 'function') {
|
||||
this.mainClass.registerChild(child, softwareType);
|
||||
}
|
||||
|
||||
this.logger.info(`✅ Child ${name} registered successfully`);
|
||||
|
||||
Reference in New Issue
Block a user