File tree 4 files changed +15
-14
lines changed
arduino-ide-extension/src
4 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -190,18 +190,21 @@ export class LibraryListWidget extends ListWidget<
190
190
) ;
191
191
}
192
192
193
- protected override filterableListSort (
193
+ protected override filterableListSort = (
194
194
items : LibraryPackage [ ]
195
- ) : LibraryPackage [ ] {
196
- const isArduinoMaintainedComparator = (
195
+ ) : LibraryPackage [ ] => {
196
+ const isArduinoTypeComparator = (
197
197
left : LibraryPackage ,
198
198
right : LibraryPackage
199
199
) => {
200
- if ( left . isArduinoMaintained && ! right . isArduinoMaintained ) {
200
+ const aIsArduinoType = left . types . includes ( 'Arduino' ) ;
201
+ const bIsArduinoType = right . types . includes ( 'Arduino' ) ;
202
+
203
+ if ( aIsArduinoType && ! bIsArduinoType ) {
201
204
return - 1 ;
202
205
}
203
206
204
- if ( ! left . isArduinoMaintained && right . isArduinoMaintained ) {
207
+ if ( ! aIsArduinoType && bIsArduinoType ) {
205
208
return 1 ;
206
209
}
207
210
@@ -210,11 +213,11 @@ export class LibraryListWidget extends ListWidget<
210
213
211
214
return items . sort ( ( left , right ) => {
212
215
return (
213
- isArduinoMaintainedComparator ( left , right ) ||
216
+ isArduinoTypeComparator ( left , right ) ||
214
217
this . defaultSortComparator ( left , right )
215
218
) ;
216
219
} ) ;
217
- }
220
+ } ;
218
221
}
219
222
220
223
class MessageBoxDialog extends AbstractDialog < MessageBoxDialog . Result > {
Original file line number Diff line number Diff line change @@ -74,14 +74,14 @@ export abstract class ListWidget<
74
74
75
75
return itemLabel ( left ) . localeCompare ( itemLabel ( right ) ) ;
76
76
} ;
77
-
78
- this . filterableListSort = this . filterableListSort . bind ( this ) ;
79
77
}
80
78
81
79
@postConstruct ( )
82
80
protected init ( ) : void {
83
81
this . toDispose . pushAll ( [
84
- this . notificationCenter . onIndexUpdateDidComplete ( ( ) => this . refresh ( undefined ) ) ,
82
+ this . notificationCenter . onIndexUpdateDidComplete ( ( ) =>
83
+ this . refresh ( undefined )
84
+ ) ,
85
85
this . notificationCenter . onDaemonDidStart ( ( ) => this . refresh ( undefined ) ) ,
86
86
this . notificationCenter . onDaemonDidStop ( ( ) => this . refresh ( undefined ) ) ,
87
87
] ) ;
@@ -141,9 +141,9 @@ export abstract class ListWidget<
141
141
return this . options . installable . uninstall ( { item, progressId } ) ;
142
142
}
143
143
144
- protected filterableListSort ( items : T [ ] ) : T [ ] {
144
+ protected filterableListSort = ( items : T [ ] ) : T [ ] => {
145
145
return items . sort ( this . defaultSortComparator ) ;
146
- }
146
+ } ;
147
147
148
148
render ( ) : React . ReactNode {
149
149
return (
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ export interface ArduinoComponent {
10
10
readonly availableVersions : Installable . Version [ ] ;
11
11
readonly installable : boolean ;
12
12
readonly installedVersion ?: Installable . Version ;
13
- readonly isArduinoMaintained ?: boolean ;
14
13
/**
15
14
* This is the `Type` in IDE (1.x) UI.
16
15
*/
Original file line number Diff line number Diff line change @@ -456,6 +456,5 @@ function toLibrary(
456
456
summary : lib . getParagraph ( ) ,
457
457
category : lib . getCategory ( ) ,
458
458
types : lib . getTypesList ( ) ,
459
- isArduinoMaintained : lib . getAuthor ( ) === 'Arduino' , // TODO check if .getMaintainer is more appropriate
460
459
} ;
461
460
}
You can’t perform that action at this time.
0 commit comments