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:
parent
4da7fc307f
commit
d3c9ff50c7
@ -172,6 +172,14 @@ export default class ToolbarService extends PubSubService {
|
|||||||
if (this.state.buttons[buttonId]) {
|
if (this.state.buttons[buttonId]) {
|
||||||
delete 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._broadcastEvent(this.EVENTS.TOOL_BAR_MODIFIED, {
|
||||||
...this.state,
|
...this.state,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user