Skip to content

Commit

Permalink
feat(toolbar): enable extensions to change toolbar button sections (O…
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrokohler committed Sep 13, 2024
1 parent 41db457 commit 8e3e879
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions platform/core/src/services/ToolBarService/ToolbarService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,11 @@ export default class ToolbarService extends PubSubService {
* @param {Array} buttons - The buttons to be added to the section.
*/
createButtonSection(key, buttons) {
// make sure all buttons have at least an empty props
this.state.buttonSections[key] = buttons;
if (this.state.buttonSections[key]) {
this.state.buttonSections[key].push(...buttons);
} else {
this.state.buttonSections[key] = buttons;
}
this._broadcastEvent(this.EVENTS.TOOL_BAR_MODIFIED, { ...this.state });
}

Expand Down

0 comments on commit 8e3e879

Please sign in to comment.