fix: Execute HP onProtocolEnter callback after HPservice.run( (#4589)

This commit is contained in:
Salim Kanoun 2025-01-09 17:15:57 +01:00 committed by GitHub
parent 98f4ac2e75
commit 8e2c607904
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -406,9 +406,7 @@ export default class HangingProtocolService extends PubSubService {
if (protocolId && typeof protocolId === 'string') { if (protocolId && typeof protocolId === 'string') {
const protocol = this.getProtocolById(protocolId); const protocol = this.getProtocolById(protocolId);
this._setProtocol(protocol, options); this._setProtocol(protocol, options);
return; }else {
}
const matchedProtocol = this.protocolEngine.run({ const matchedProtocol = this.protocolEngine.run({
studies: this.studies, studies: this.studies,
activeStudy, activeStudy,
@ -417,6 +415,9 @@ export default class HangingProtocolService extends PubSubService {
this._setProtocol(matchedProtocol); this._setProtocol(matchedProtocol);
} }
this._commandsManager.run(this.protocol?.callbacks?.onProtocolEnter);
}
/** /**
* Returns true, if the hangingProtocol has a custom loading strategy for the images * Returns true, if the hangingProtocol has a custom loading strategy for the images
* and its callback has been added to the HangingProtocolService * and its callback has been added to the HangingProtocolService