File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,38 +152,21 @@ class SyncStatusBar {
152152
153153export class StatusBarCommands {
154154
155+ readonly onDidChange : Event < void > ;
156+
155157 private syncStatusBar : SyncStatusBar ;
156158 private checkoutStatusBar : CheckoutStatusBar ;
157159 private disposables : Disposable [ ] = [ ] ;
158160
159161 constructor ( repository : Repository ) {
160162 this . syncStatusBar = new SyncStatusBar ( repository ) ;
161163 this . checkoutStatusBar = new CheckoutStatusBar ( repository ) ;
162- }
163-
164- get onDidChange ( ) : Event < void > {
165- return anyEvent (
166- this . syncStatusBar . onDidChange ,
167- this . checkoutStatusBar . onDidChange
168- ) ;
164+ this . onDidChange = anyEvent ( this . syncStatusBar . onDidChange , this . checkoutStatusBar . onDidChange ) ;
169165 }
170166
171167 get commands ( ) : Command [ ] {
172- const result : Command [ ] = [ ] ;
173-
174- const checkout = this . checkoutStatusBar . command ;
175-
176- if ( checkout ) {
177- result . push ( checkout ) ;
178- }
179-
180- const sync = this . syncStatusBar . command ;
181-
182- if ( sync ) {
183- result . push ( sync ) ;
184- }
185-
186- return result ;
168+ return [ this . checkoutStatusBar . command , this . syncStatusBar . command ]
169+ . filter ( ( c ) : c is Command => ! ! c ) ;
187170 }
188171
189172 dispose ( ) : void {
You can’t perform that action at this time.
0 commit comments