File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,18 @@ export class RunStore extends EventEmitter<RunStoreEvent> {
2121 private runs = new Map < number , WorkflowRun > ( ) ;
2222 private updaters = new Map < number , Updater > ( ) ;
2323 private _isFocused = true ;
24+ private _isViewVisible = true ;
2425
2526 setFocused ( focused : boolean ) {
2627 this . _isFocused = focused ;
2728 logDebug ( `[Store]: Focus state changed to ${ focused } ` ) ;
2829 }
2930
31+ setViewVisible ( visible : boolean ) {
32+ this . _isViewVisible = visible ;
33+ logDebug ( `[Store]: View visibility changed to ${ visible } ` ) ;
34+ }
35+
3036 getRun ( runId : number ) : WorkflowRun | undefined {
3137 return this . runs . get ( runId ) ;
3238 }
@@ -72,7 +78,7 @@ export class RunStore extends EventEmitter<RunStoreEvent> {
7278 }
7379
7480 private async fetchRun ( updater : Updater ) {
75- if ( ! this . _isFocused ) {
81+ if ( ! this . _isFocused || ! this . _isViewVisible ) {
7682 return ;
7783 }
7884
Original file line number Diff line number Diff line change @@ -11,7 +11,15 @@ import {WorkflowsTreeProvider} from "./workflows";
1111
1212export async function initTreeViews ( context : vscode . ExtensionContext , store : RunStore ) : Promise < void > {
1313 const workflowTreeProvider = new WorkflowsTreeProvider ( store ) ;
14- context . subscriptions . push ( vscode . window . registerTreeDataProvider ( "github-actions.workflows" , workflowTreeProvider ) ) ;
14+ const workflowTreeView = vscode . window . createTreeView ( "github-actions.workflows" , {
15+ treeDataProvider : workflowTreeProvider
16+ } ) ;
17+ context . subscriptions . push ( workflowTreeView ) ;
18+
19+ store . setViewVisible ( workflowTreeView . visible ) ;
20+ workflowTreeView . onDidChangeVisibility ( e => {
21+ store . setViewVisible ( e . visible ) ;
22+ } ) ;
1523
1624 const settingsTreeProvider = new SettingsTreeProvider ( ) ;
1725 context . subscriptions . push ( vscode . window . registerTreeDataProvider ( "github-actions.settings" , settingsTreeProvider ) ) ;
You can’t perform that action at this time.
0 commit comments