@@ -249,29 +249,41 @@ class StudioActions {
249
249
location : vscode . ProgressLocation . Notification ,
250
250
title : `Executing user action: ${ action . label } ` ,
251
251
} ,
252
- ( ) =>
253
- this . api
254
- . actionQuery ( query , parameters )
255
- . then ( async ( data ) => {
256
- if ( action . save ) {
257
- await this . processSaveFlag ( action . save ) ;
258
- }
259
- outputConsole ( data . console ) ;
260
- return data . result . content . pop ( ) ;
261
- } )
262
- . then ( this . processUserAction )
263
- . then ( ( answer ) => {
264
- if ( answer ) {
265
- return answer . msg || answer . msg === ""
266
- ? this . userAction ( action , true , answer . answer , answer . msg , type )
267
- : this . userAction ( action , true , answer , "" , type ) ;
268
- }
269
- } )
270
- . catch ( ( err ) => {
271
- console . log ( err ) ;
272
- outputChannel . appendLine ( `Studio Action "${ action . label } " not supported` ) ;
273
- outputChannel . show ( ) ;
274
- } )
252
+ ( ) => {
253
+ return new Promise ( ( resolve ) => {
254
+ this . api
255
+ . actionQuery ( query , parameters )
256
+ . then ( async ( data ) => {
257
+ if ( action . save ) {
258
+ await this . processSaveFlag ( action . save ) ;
259
+ }
260
+ if ( ! afterUserAction ) {
261
+ outputConsole ( data . console ) ;
262
+ }
263
+ const actionToProcess = data . result . content . pop ( ) ;
264
+
265
+ // CSP pages should not have a progress bar
266
+ if ( actionToProcess . action === 2 ) {
267
+ resolve ( ) ;
268
+ }
269
+ return actionToProcess ;
270
+ } )
271
+ . then ( this . processUserAction )
272
+ . then ( ( answer ) => {
273
+ if ( answer ) {
274
+ return answer . msg || answer . msg === ""
275
+ ? this . userAction ( action , true , answer . answer , answer . msg , type )
276
+ : this . userAction ( action , true , answer , "" , type ) ;
277
+ }
278
+ } )
279
+ . then ( ( ) => resolve ( ) )
280
+ . catch ( ( err ) => {
281
+ console . log ( err ) ;
282
+ outputChannel . appendLine ( `Studio Action "${ action . label } " not supported` ) ;
283
+ outputChannel . show ( ) ;
284
+ } ) ;
285
+ } ) ;
286
+ }
275
287
) ;
276
288
}
277
289
0 commit comments