fix(ToolbarService): Fixed removeButton bug for removing buttons inside sections (#5123)

Co-authored-by: Dan Elkis <dan.elkis@signalpet.com>
This commit is contained in:
Dan 2025-06-11 16:00:54 +03:00 committed by GitHub
parent 4da7fc307f
commit d3c9ff50c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -172,6 +172,14 @@ export default class ToolbarService extends PubSubService {
if (this.state.buttons[buttonId]) {
delete this.state.buttons[buttonId];
}
// Remove button from all sections
Object.keys(this.state.buttonSections).forEach(sectionKey => {
this.state.buttonSections[sectionKey] = this.state.buttonSections[sectionKey].filter(
id => id !== buttonId
);
});
this._broadcastEvent(this.EVENTS.TOOL_BAR_MODIFIED, {
...this.state,
});