diff --git a/platform/core/src/services/ToolBarService/ToolbarService.ts b/platform/core/src/services/ToolBarService/ToolbarService.ts index a132d779e..b69bb8726 100644 --- a/platform/core/src/services/ToolBarService/ToolbarService.ts +++ b/platform/core/src/services/ToolBarService/ToolbarService.ts @@ -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, });