@@ -12,9 +12,9 @@ import {
12
12
WebviewViewResolveContext ,
13
13
Uri ,
14
14
} from 'vscode'
15
- import { LanguageServerResolver } from 'aws-core-vscode/shared'
16
15
import { QuickActionCommandGroup } from '@aws/mynah-ui'
17
16
import * as path from 'path'
17
+ import { AmazonQPromptSettings , LanguageServerResolver } from 'aws-core-vscode/shared'
18
18
19
19
export class AmazonQChatViewProvider implements WebviewViewProvider {
20
20
public static readonly viewType = 'aws.amazonq.AmazonQChatView'
@@ -43,7 +43,11 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
43
43
44
44
constructor ( private readonly mynahUIPath : string ) { }
45
45
46
- public resolveWebviewView ( webviewView : WebviewView , context : WebviewViewResolveContext , _token : CancellationToken ) {
46
+ public async resolveWebviewView (
47
+ webviewView : WebviewView ,
48
+ context : WebviewViewResolveContext ,
49
+ _token : CancellationToken
50
+ ) {
47
51
this . webview = webviewView . webview
48
52
49
53
const lspDir = Uri . parse ( LanguageServerResolver . defaultDir )
@@ -54,12 +58,13 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
54
58
}
55
59
56
60
const uiPath = webviewView . webview . asWebviewUri ( Uri . parse ( this . mynahUIPath ) ) . toString ( )
57
- webviewView . webview . html = this . getWebviewContent ( uiPath )
61
+ webviewView . webview . html = await this . getWebviewContent ( uiPath )
58
62
59
63
this . onDidResolveWebviewEmitter . fire ( )
60
64
}
61
65
62
- private getWebviewContent ( mynahUIPath : string ) {
66
+ private async getWebviewContent ( mynahUIPath : string ) {
67
+ const disclaimerAcknowledged = AmazonQPromptSettings . instance . isPromptEnabled ( 'amazonQChatDisclaimer' )
63
68
return `
64
69
<!DOCTYPE html>
65
70
<html lang="en">
@@ -84,7 +89,7 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
84
89
<script type="text/javascript" src="${ mynahUIPath . toString ( ) } " defer onload="init()"></script>
85
90
<script type="text/javascript">
86
91
const init = () => {
87
- amazonQChat.createChat(acquireVsCodeApi(), { disclaimerAcknowledged: false , quickActionCommands: ${ JSON . stringify ( this . quickActionCommands ) } });
92
+ amazonQChat.createChat(acquireVsCodeApi(), { disclaimerAcknowledged: ${ disclaimerAcknowledged } , quickActionCommands: ${ JSON . stringify ( this . quickActionCommands ) } });
88
93
}
89
94
</script>
90
95
</body>
0 commit comments