fix(Customization): Fixed incorrect events broadcast (#5075)

Co-authored-by: Dan Elkis <dan.elkis@signalpet.com>
This commit is contained in:
Dan 2025-05-28 16:08:05 +03:00 committed by GitHub
parent a8d438d8f7
commit c88bdac4b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),
});