Skip to content

Commit 3b5f93b

Browse files
authored
difficult to dismiss badge for notifications (#7202)
Fixes #7184
1 parent 53fedcd commit 3b5f93b

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/view/prsTreeDataProvider.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,7 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T
7474

7575
this._register(this._view.onDidChangeVisibility(e => {
7676
if (e.visible) {
77-
// Clear notifications with a delay of 5 seconds
78-
if (this._notificationClearTimeout) {
79-
clearTimeout(this._notificationClearTimeout);
80-
}
81-
this._notificationClearTimeout = setTimeout(() => {
82-
_copilotManager.clearNotifications();
83-
this._view.badge = undefined;
84-
this._notificationClearTimeout = undefined;
85-
}, 5000);
86-
77+
this._clearNotificationsWithDelay();
8778
// Sync with currently active PR when view becomes visible
8879
const currentPR = PullRequestOverviewPanel.getCurrentPullRequest();
8980
if (currentPR) {
@@ -169,6 +160,18 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T
169160
}));
170161
}
171162

163+
private _clearNotificationsWithDelay() {
164+
if (this._notificationClearTimeout) {
165+
return;
166+
}
167+
// Clear notifications with a delay of 5 seconds)
168+
this._notificationClearTimeout = setTimeout(() => {
169+
this._copilotManager.clearNotifications();
170+
this._view.badge = undefined;
171+
this._notificationClearTimeout = undefined;
172+
}, 5000);
173+
}
174+
172175
public async expandPullRequest(pullRequest: PullRequestModel) {
173176
if (this._children.length === 0) {
174177
await this.getChildren();

0 commit comments

Comments
 (0)