Skip to content

Commit

Permalink
Fix console error when adding a widget to a side panel (#6694)
Browse files Browse the repository at this point in the history
* Fix console error when adding a widget to a side panel

* Remove child-added logic
  • Loading branch information
jtpio authored Jan 16, 2023
1 parent 7eb832d commit ffc7d8d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions packages/application/src/panelhandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,13 @@ export class PanelHandler {
}

/**
* A message hook for child add/remove messages on the main area dock panel.
* A message hook for child remove messages on the panel handler.
*/
private _panelChildHook = (
handler: IMessageHandler,
msg: Message
): boolean => {
switch (msg.type) {
case 'child-added':
{
const widget = (msg as Widget.ChildMessage).child;
// If we already know about this widget, we're done
if (this._items.find(v => v.widget === widget)) {
break;
}

// Otherwise, add to the end by default
const rank = this._items[this._items.length - 1].rank;
this._items.push({ widget, rank });
}
break;
case 'child-removed':
{
const widget = (msg as Widget.ChildMessage).child;
Expand Down

0 comments on commit ffc7d8d

Please sign in to comment.