mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
💄
This commit is contained in:
@@ -152,6 +152,8 @@ class SyncStatusBar {
|
||||
|
||||
export class StatusBarCommands {
|
||||
|
||||
readonly onDidChange: Event<void>;
|
||||
|
||||
private syncStatusBar: SyncStatusBar;
|
||||
private checkoutStatusBar: CheckoutStatusBar;
|
||||
private disposables: Disposable[] = [];
|
||||
@@ -159,31 +161,12 @@ export class StatusBarCommands {
|
||||
constructor(repository: Repository) {
|
||||
this.syncStatusBar = new SyncStatusBar(repository);
|
||||
this.checkoutStatusBar = new CheckoutStatusBar(repository);
|
||||
}
|
||||
|
||||
get onDidChange(): Event<void> {
|
||||
return anyEvent(
|
||||
this.syncStatusBar.onDidChange,
|
||||
this.checkoutStatusBar.onDidChange
|
||||
);
|
||||
this.onDidChange = anyEvent(this.syncStatusBar.onDidChange, this.checkoutStatusBar.onDidChange);
|
||||
}
|
||||
|
||||
get commands(): Command[] {
|
||||
const result: Command[] = [];
|
||||
|
||||
const checkout = this.checkoutStatusBar.command;
|
||||
|
||||
if (checkout) {
|
||||
result.push(checkout);
|
||||
}
|
||||
|
||||
const sync = this.syncStatusBar.command;
|
||||
|
||||
if (sync) {
|
||||
result.push(sync);
|
||||
}
|
||||
|
||||
return result;
|
||||
return [this.checkoutStatusBar.command, this.syncStatusBar.command]
|
||||
.filter((c): c is Command => !!c);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
|
||||
Reference in New Issue
Block a user