Skip to content

Commit e7ab4ee

Browse files
Updates indicator when launchpad item status changes (#4103)
1 parent 2b163fb commit e7ab4ee

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/plus/launchpad/launchpadIndicator.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class LaunchpadIndicator implements Disposable {
3838
) {
3939
this._disposable = Disposable.from(
4040
window.onDidChangeWindowState(this.onWindowStateChanged, this),
41+
provider.onDidChange(this.onLaunchpadChanged, this),
4142
provider.onDidRefresh(this.onLaunchpadRefreshed, this),
4243
configuration.onDidChange(this.onConfigurationChanged, this),
4344
container.integrations.onDidChangeConnectionState(this.onConnectedIntegrationsChanged, this),
@@ -130,6 +131,24 @@ export class LaunchpadIndicator implements Disposable {
130131
this.updateStatusBarState('load', e.items);
131132
}
132133

134+
private async onLaunchpadChanged() {
135+
this._hasRefreshed = false;
136+
if (!this.pollingEnabled) {
137+
this.updateStatusBarState('idle');
138+
139+
return;
140+
}
141+
142+
const items = await this.provider.getCategorizedItems();
143+
if (items.error != null) {
144+
this.updateStatusBarState('failed');
145+
146+
return;
147+
}
148+
149+
this.updateStatusBarState('load', items.items);
150+
}
151+
133152
private async onReady(): Promise<void> {
134153
this._statusBarLaunchpad = window.createStatusBarItem('gitlens.launchpad', StatusBarAlignment.Left, 10000 - 3);
135154
this._statusBarLaunchpad.name = 'GitLens Launchpad';

0 commit comments

Comments
 (0)