File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
arduino-ide-extension/src/browser/widgets/component-list Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ export abstract class ListWidget<
42
42
protected readonly filterTextChangeEmitter = new Emitter <
43
43
string | undefined
44
44
> ( ) ;
45
+ /**
46
+ * Instead of running an `update` from the `postConstruct` `init` method,
47
+ * we use this variable to track first activate, then run.
48
+ */
49
+ protected firstActivate = true ;
45
50
46
51
constructor ( protected options : ListWidget . Options < T > ) {
47
52
super ( ) ;
@@ -61,7 +66,6 @@ export abstract class ListWidget<
61
66
62
67
@postConstruct ( )
63
68
protected init ( ) : void {
64
- this . update ( ) ;
65
69
this . toDispose . pushAll ( [
66
70
this . notificationCenter . onIndexUpdated ( ( ) => this . refresh ( undefined ) ) ,
67
71
this . notificationCenter . onDaemonStarted ( ( ) => this . refresh ( undefined ) ) ,
@@ -74,6 +78,10 @@ export abstract class ListWidget<
74
78
}
75
79
76
80
protected override onActivateRequest ( message : Message ) : void {
81
+ if ( this . firstActivate ) {
82
+ this . firstActivate = false ;
83
+ this . update ( ) ;
84
+ }
77
85
super . onActivateRequest ( message ) ;
78
86
( this . focusNode || this . node ) . focus ( ) ;
79
87
}
You can’t perform that action at this time.
0 commit comments