From 1fe08837b4a581be9b430e730a7a7078c515e888 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 23 Sep 2020 21:40:44 -0400 Subject: [PATCH] Adds visibility check to determine usage --- src/commands/gitCommands.actions.ts | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/commands/gitCommands.actions.ts b/src/commands/gitCommands.actions.ts index a9064bd..093ac6f 100644 --- a/src/commands/gitCommands.actions.ts +++ b/src/commands/gitCommands.actions.ts @@ -142,7 +142,11 @@ export namespace GitActions { expand?: boolean | number; }, ) { - if (configuration.get('views', 'repositories', 'enabled')) { + if ( + configuration.get('views', 'repositories', 'enabled') && + (Container.repositoriesView.visible || + (branch.remote ? !Container.remotesView.visible : !Container.branchesView.visible)) + ) { return Container.repositoriesView.revealBranch(branch, options); } @@ -673,7 +677,10 @@ export namespace GitActions { expand?: boolean | number; }, ) { - if (configuration.get('views', 'repositories', 'enabled')) { + if ( + configuration.get('views', 'repositories', 'enabled') && + (Container.repositoriesView.visible || !Container.commitsView.visible) + ) { return Container.repositoriesView.revealCommit(commit, options); } @@ -737,7 +744,10 @@ export namespace GitActions { expand?: boolean | number; }, ) { - if (configuration.get('views', 'repositories', 'enabled')) { + if ( + configuration.get('views', 'repositories', 'enabled') && + (Container.repositoriesView.visible || !Container.tagsView.visible) + ) { return Container.repositoriesView.revealTag(tag, options); } @@ -794,7 +804,10 @@ export namespace GitActions { expand?: boolean | number; }, ) { - // if (configuration.get('views', 'repositories', 'enabled')) { + // if ( + // configuration.get('views', 'repositories', 'enabled') && + // (Container.repositoriesView.visible || !Container.remotesView.visible) + // ) { // return Container.repositoriesView.revealRemote(remote, options); // } @@ -846,7 +859,10 @@ export namespace GitActions { expand?: boolean | number; }, ) { - if (configuration.get('views', 'repositories', 'enabled')) { + if ( + configuration.get('views', 'repositories', 'enabled') && + (Container.repositoriesView.visible || !Container.stashesView.visible) + ) { return Container.repositoriesView.revealStash(stash, options); }