11import { consume } from '@lit/context' ;
2+ import { SignalWatcher } from '@lit-labs/signals' ;
23import { css , html } from 'lit' ;
3- import { customElement , state } from 'lit/decorators.js' ;
4+ import { customElement } from 'lit/decorators.js' ;
45import { ifDefined } from 'lit/directives/if-defined.js' ;
56import { createWebviewCommandLink } from '../../../../system/webview' ;
6- import type { State } from '../../../plus/graph/protocol' ;
77import { GlElement } from '../../shared/components/element' ;
88import { linkStyles } from '../shared/components/vscode.css' ;
9- import { stateContext } from './context ' ;
9+ import { graphStateContext } from './stateProvider ' ;
1010import '../../shared/components/feature-badge' ;
1111import '../../shared/components/feature-gate' ;
1212
1313@customElement ( 'gl-graph-gate' )
14- export class GlGraphGate extends GlElement {
14+ export class GlGraphGate extends SignalWatcher ( GlElement ) {
1515 static override styles = [
1616 linkStyles ,
1717 css `
@@ -23,29 +23,28 @@ export class GlGraphGate extends GlElement {
2323 ` ,
2424 ] ;
2525
26- @consume ( { context : stateContext , subscribe : true } )
27- @state ( )
28- state ! : State ;
26+ @consume ( { context : graphStateContext , subscribe : true } )
27+ graphState ! : typeof graphStateContext . __context__ ;
2928
3029 override render ( ) {
3130 return html `< gl-feature-gate
32- .featurePreview =${ this . state . featurePreview }
31+ .featurePreview =${ this . graphState . featurePreview }
3332 featurePreviewCommandLink =${ ifDefined (
34- this . state . featurePreview
33+ this . graphState . featurePreview
3534 ? createWebviewCommandLink (
3635 'gitlens.plus.continueFeaturePreview' ,
37- this . state . webviewId ,
38- this . state . webviewInstanceId ,
39- { feature : this . state . featurePreview . feature } ,
36+ this . graphState . webviewId ,
37+ this . graphState . webviewInstanceId ,
38+ { feature : this . graphState . featurePreview . feature } ,
4039 )
4140 : undefined ,
4241 ) }
4342 appearance="alert"
4443 featureWithArticleIfNeeded="the Commit Graph"
45- ?hidden=${ this . state . allowed !== false }
44+ ?hidden=${ this . graphState . allowed !== false }
4645 .source=${ { source : 'graph' , detail : 'gate' } as const }
47- .state=${ this . state . subscription ?. state }
48- .webroot=${ this . state . webroot }
46+ .state=${ this . graphState . subscription ?. state }
47+ .webroot=${ this . graphState . webroot }
4948 >
5049 < p slot ="feature ">
5150 < a href ="https://help.gitkraken.com/gitlens/gitlens-features/#commit-graph-pro "> Commit Graph</ a >
0 commit comments