Skip to content

Commit 6981f7c

Browse files
committed
💄
1 parent 6d12727 commit 6981f7c

1 file changed

Lines changed: 5 additions & 22 deletions

File tree

extensions/git/src/statusbar.ts

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -152,38 +152,21 @@ class SyncStatusBar {
152152

153153
export 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 {

0 commit comments

Comments
 (0)