@@ -24,7 +24,7 @@ class ReactWebView {
2424
2525// Listen for when the panel is disposed
2626// This happens when the user closes the panel or when the panel is closed programatically
27- this . panel . onDidDispose ( ( ) => this . dispose ( ) , null , this . disposables )
27+ this . panel . onDidDispose ( this . dispose , this , this . disposables )
2828
2929// Handle messages from the webview
3030const onReceive = ( action :string | CR . Action ) => {
@@ -91,16 +91,10 @@ class ReactWebView {
9191}
9292}
9393
94- public dispose ( ) :void {
94+ private async dispose ( ) :Promise < void > {
9595// Clean up our resources
9696this . panel . dispose ( )
97-
98- while ( this . disposables . length ) {
99- const x = this . disposables . pop ( )
100- if ( x ) {
101- x . dispose ( )
102- }
103- }
97+ Promise . all ( this . disposables . map ( ( x ) => x . dispose ( ) ) )
10498}
10599
106100private createWebviewPanel ( column :number ) :vscode . WebviewPanel {
@@ -153,14 +147,15 @@ class ReactWebView {
153147 <meta name='theme-color' content='#000000'>
154148 <title>React App</title>
155149 <link rel='manifest' href='./manifest.json' />
150+
156151 <!-- TODO: load styles through package -->
157152 <link rel='stylesheet' href='https://unpkg.com/@alifd/next/dist/next.css' />
158153 <link rel='stylesheet' type='text/css' href='${ styleUri } '>
154+
159155 <meta http-equiv='Content-Security-Policy' content="font-src *; img-src vscode-resource: https:; script-src 'nonce-${ n1 } ' 'nonce-${ n2 } ' 'nonce-${ n3 } '; style-src vscode-resource: 'unsafe-inline' http: https: data:;">
160156 <base href='${ vscode . Uri . file ( path . join ( this . extensionPath , 'build' ) ) . with ( {
161157scheme :'vscode-resource' ,
162158} ) } /'>
163- <style></style>
164159 </head>
165160
166161 <body>