File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
arduino-ide-extension/src/browser/widgets/sketchbook Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,19 @@ export class SketchbookWidget extends BaseWidget {
73
73
console . warn ( `Could not find tree widget with ID: ${ widget } ` ) ;
74
74
return ;
75
75
}
76
- const treeWidget = this . treeWidget (
76
+ // TODO: remove this when the remote/local sketchbooks and their widgets are cleaned up.
77
+ const findTreeWidget = (
78
+ widget : Widget | undefined
79
+ ) : TreeWidget | undefined => {
80
+ if ( widget instanceof TreeWidget ) {
81
+ return widget ;
82
+ }
83
+ if ( widget instanceof CloudSketchbookCompositeWidget ) {
84
+ return widget . getTreeWidget ( ) ;
85
+ }
86
+ return undefined ;
87
+ } ;
88
+ const treeWidget = findTreeWidget (
77
89
toArray ( this . sketchbookTreesContainer . widgets ( ) )
78
90
. filter ( ( { id } ) => id === treeWidgetId )
79
91
. shift ( )
@@ -95,16 +107,6 @@ export class SketchbookWidget extends BaseWidget {
95
107
treeWidget . model . selectNode ( treeNode ) ;
96
108
}
97
109
98
- private treeWidget ( widget : Widget | undefined ) : TreeWidget | undefined {
99
- if ( widget instanceof TreeWidget ) {
100
- return widget ;
101
- }
102
- if ( widget instanceof CloudSketchbookCompositeWidget ) {
103
- return widget . getTreeWidget ( ) ;
104
- }
105
- return undefined ;
106
- }
107
-
108
110
protected override onActivateRequest ( message : Message ) : void {
109
111
super . onActivateRequest ( message ) ;
110
112
You can’t perform that action at this time.
0 commit comments