@@ -197,12 +197,20 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T
197197 this . _autoRefreshTimer = setInterval ( ( ) => {
198198 Logger . appendLine ( 'Auto-refreshing pull requests queries' , 'PullRequestsTreeDataProvider' ) ;
199199 this . prsTreeModel . forceClearCache ( ) ;
200- this . refreshAllQueryResults ( true ) ;
200+ this . tryReset ( true ) ;
201+ this . fireRefresh ( ) ;
201202 } , intervalMs ) ;
202203
203204 Logger . appendLine ( `Auto-refresh enabled with interval of ${ actualIntervalMinutes } minutes` , 'PullRequestsTreeDataProvider' ) ;
204205 }
205206
207+ private resetAutoRefreshTimer ( ) : void {
208+ // Only reset if auto-refresh is currently enabled
209+ if ( this . _autoRefreshTimer ) {
210+ this . setupAutoRefresh ( ) ;
211+ }
212+ }
213+
206214 private filterNotificationsToKnown ( notifications : PullRequestModel [ ] ) : PullRequestModel [ ] {
207215 return notifications . filter ( notification => {
208216 if ( ! this . prsTreeModel . hasPullRequest ( notification ) ) {
@@ -414,9 +422,7 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T
414422 }
415423 }
416424
417- private refreshAllQueryResults ( reset ?: boolean ) {
418- this . tryReset ( ! ! reset ) ;
419-
425+ private fireRefresh ( ) {
420426 if ( ! this . _children || this . _children . length === 0 ) {
421427 this . _onDidChangeTreeData . fire ( ) ;
422428 return ;
@@ -429,6 +435,15 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T
429435 this . refreshQueryResultsForFolder ( ) ;
430436 }
431437
438+ private refreshAllQueryResults ( reset ?: boolean ) {
439+ this . tryReset ( ! ! reset ) ;
440+
441+ // Reset the auto-refresh timer whenever a refresh is triggered
442+ this . resetAutoRefreshTimer ( ) ;
443+
444+ this . fireRefresh ( ) ;
445+ }
446+
432447 private refreshQueryResultsForFolder ( manager ?: WorkspaceFolderNode , reset ?: boolean ) {
433448 if ( ! manager && this . _children [ 0 ] instanceof WorkspaceFolderNode ) {
434449 // Not permitted. There're multiple folder nodes, therefore must specify which one to refresh
0 commit comments