add a few more awaits

This commit is contained in:
Scott Bell 2024-10-09 13:20:11 +02:00
parent 7c01a5e0d7
commit bf9d5ef4a7
2 changed files with 10 additions and 1 deletions

View File

@ -131,6 +131,10 @@ export default class CompsManager extends EventEmitter {
await this.#loadComposition();
// Check if a newer load has been initiated
if (loadVersion !== this.#loadVersion) {
console.debug(
`🔄 Reloading comps manager in composition wait ${this.#domainObject.name} due to newer load.`
);
await this.#currentLoadPromise;
return;
}
this.#compositionLoaded = true;
@ -141,13 +145,17 @@ export default class CompsManager extends EventEmitter {
await this.#startListeningToUnderlyingTelemetry();
// Check again for newer load
if (loadVersion !== this.#loadVersion) {
console.debug(
`🔄 Reloading comps manager in telemetry wait ${this.#domainObject.name} due to newer load.`
);
await this.#currentLoadPromise;
return;
}
this.#loaded = true;
console.debug(
`✅ Comps manager ${this.#domainObject.name} is ready.`,
this.#telemetryCollections
);
this.#loaded = true;
}
})();

View File

@ -27,6 +27,7 @@ onconnect = function (e) {
} catch (errorInCalculation) {
error = errorInCalculation;
}
console.debug(`📭 Sending response for callback ID ${callbackID}`, result);
port.postMessage({ type: responseType, callbackID, result, error });
};
};