diff --git a/platform/core/src/services/CustomizationService/CustomizationService.ts b/platform/core/src/services/CustomizationService/CustomizationService.ts index e8ffa6001..fd14b3bef 100644 --- a/platform/core/src/services/CustomizationService/CustomizationService.ts +++ b/platform/core/src/services/CustomizationService/CustomizationService.ts @@ -161,10 +161,11 @@ export default class CustomizationService extends PubSubService { * @param customizationId - The ID of the customization to retrieve. * @param scope - (Optional) The scope to retrieve from: 'global', 'mode', or 'default'. * If not specified, it retrieves based on priority: global > mode > default. - * @returns The requested customization. + * @returns The requested customization, or undefined if not found */ - public getCustomization(customizationId: string): Customization { + public getCustomization(customizationId: string): Customization | undefined { const transformed = this.transformedCustomizations.get(customizationId); + if (transformed) { return transformed; } @@ -320,7 +321,7 @@ export default class CustomizationService extends PubSubService { this.modeCustomizations.set(customizationId, result); this.transformedCustomizations.clear(); - this._broadcastEvent(this.EVENTS.CUSTOMIZATION_MODIFIED, { + this._broadcastEvent(this.EVENTS.MODE_CUSTOMIZATION_MODIFIED, { buttons: this.modeCustomizations, button: this.modeCustomizations.get(customizationId), }); @@ -334,7 +335,7 @@ export default class CustomizationService extends PubSubService { this.globalCustomizations.set(id, this._update(sourceCustomization, value)); this.transformedCustomizations.clear(); - this._broadcastEvent(this.EVENTS.DEFAULT_CUSTOMIZATION_MODIFIED, { + this._broadcastEvent(this.EVENTS.GLOBAL_CUSTOMIZATION_MODIFIED, { buttons: this.defaultCustomizations, button: this.defaultCustomizations.get(id), });