Browse Source

Hides graph status bar entry if no repo open

main
Eric Amodio 2 years ago
parent
commit
f86dc001d4
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/plus/webviews/graph/graphWebview.ts

+ 4
- 3
src/plus/webviews/graph/graphWebview.ts View File

@ -28,7 +28,7 @@ import { GitActions } from '../../../commands/gitCommands.actions';
import { configuration } from '../../../configuration';
import { Commands, ContextKeys, CoreGitCommands } from '../../../constants';
import type { Container } from '../../../container';
import { onDidChangeContext, setContext } from '../../../context';
import { getContext, onDidChangeContext, setContext } from '../../../context';
import { PlusFeatures } from '../../../features';
import type { GitCommit } from '../../../git/models/commit';
import { GitGraphRowType } from '../../../git/models/graph';
@ -188,7 +188,7 @@ export class GraphWebview extends WebviewBase {
configuration.onDidChange(this.onConfigurationChanged, this),
once(container.onReady)(() => queueMicrotask(() => this.updateStatusBar())),
onDidChangeContext(key => {
if (key !== ContextKeys.PlusEnabled) return;
if (key !== ContextKeys.Enabled && key !== ContextKeys.PlusEnabled) return;
this.updateStatusBar();
}),
{ dispose: () => this._statusBarItem?.dispose() },
@ -1101,7 +1101,8 @@ export class GraphWebview extends WebviewBase {
}
private updateStatusBar() {
const enabled = configuration.get('graph.statusBar.enabled') && arePlusFeaturesEnabled();
const enabled =
configuration.get('graph.statusBar.enabled') && getContext(ContextKeys.Enabled) && arePlusFeaturesEnabled();
if (enabled) {
if (this._statusBarItem == null) {
this._statusBarItem = window.createStatusBarItem('gitlens.graph', StatusBarAlignment.Left, 10000 - 3);

||||||
x
 
000:0
Loading…
Cancel
Save