@@ -251,43 +251,46 @@ class StudioActions {
251251 title : `Executing ${ afterUserAction ? "AfterUserAction" : "UserAction" } : ${ action . label } ` ,
252252 } ,
253253 ( ) => {
254- return 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- if ( ! data . result . content . length ) {
264- // nothing to-do, just ignore it
265- return ;
266- }
267- const actionToProcess = data . result . content . pop ( ) ;
254+ return new Promise ( ( resolve , reject ) => {
255+ this . api
256+ . actionQuery ( query , parameters )
257+ . then ( async ( data ) => {
258+ if ( action . save ) {
259+ await this . processSaveFlag ( action . save ) ;
260+ }
261+ if ( ! afterUserAction ) {
262+ outputConsole ( data . console ) ;
263+ }
264+ if ( ! data . result . content . length ) {
265+ // nothing to-do, just ignore it
266+ return ;
267+ }
268+ const actionToProcess = data . result . content . pop ( ) ;
268269
269- // CSP pages should not have a progress bar
270- if ( actionToProcess . action === 2 ) {
271- return ;
272- }
273- return actionToProcess ;
274- } )
275- . then (
276- ( actionToProcess ) =>
277- actionToProcess &&
278- ! afterUserAction &&
279- this . processUserAction ( actionToProcess ) . then ( ( answer ) =>
280- answer && ( answer . msg || answer . msg === "" )
281- ? this . userAction ( action , true , answer . answer , answer . msg , type )
282- : this . userAction ( action , true , answer , "" , type )
283- )
284- )
285- . catch ( ( err ) => {
286- console . log ( err ) ;
287- outputChannel . appendLine ( `Studio Action "${ action . label } " not supported` ) ;
288- outputChannel . show ( ) ;
289- return Promise . reject ( ) ;
290- } ) ;
270+ // CSP pages should not have a progress bar
271+ if ( actionToProcess . action === 2 ) {
272+ resolve ( ) ;
273+ }
274+ return actionToProcess ;
275+ } )
276+ . then (
277+ ( actionToProcess ) =>
278+ actionToProcess &&
279+ ! afterUserAction &&
280+ this . processUserAction ( actionToProcess ) . then ( ( answer ) =>
281+ answer && ( answer . msg || answer . msg === "" )
282+ ? this . userAction ( action , true , answer . answer , answer . msg , type )
283+ : this . userAction ( action , true , answer , "" , type )
284+ )
285+ )
286+ . then ( ( ) => resolve ( ) )
287+ . catch ( ( err ) => {
288+ console . log ( err ) ;
289+ outputChannel . appendLine ( `Studio Action "${ action . label } " not supported` ) ;
290+ outputChannel . show ( ) ;
291+ reject ( ) ;
292+ } ) ;
293+ } ) ;
291294 }
292295 ) ;
293296 }
0 commit comments