File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments