@@ -212,7 +212,7 @@ async function runMultipleHandler(mode: `all`|`selected`|`from`) {
212
212
) ,
213
213
group : statementsToRun [ i ] ,
214
214
qualifier : prefix ,
215
- noUi : i < statementsToRun . length - 1 , // Only the last one should have a UI
215
+ noUi : true
216
216
} ) ;
217
217
}
218
218
}
@@ -222,6 +222,9 @@ async function runMultipleHandler(mode: `all`|`selected`|`from`) {
222
222
return ;
223
223
}
224
224
225
+ // Last statement should have UI
226
+ statementInfos [ statementInfos . length - 1 ] . noUi = false ;
227
+
225
228
for ( let statementInfo of statementInfos ) {
226
229
try {
227
230
await runHandler ( statementInfo ) ;
@@ -302,6 +305,7 @@ async function runHandler(options?: StatementInfo) {
302
305
if ( statementDetail . qualifier === `cl` ) {
303
306
// TODO: handle noUi
304
307
if ( options . noUi ) {
308
+ setCancelButtonVisibility ( true ) ;
305
309
const command = statementDetail . content . split ( ` ` ) [ 0 ] . toUpperCase ( ) ;
306
310
307
311
chosenView . setLoadingText ( `Running CL command... (${ command } )` , false ) ;
@@ -321,6 +325,7 @@ async function runHandler(options?: StatementInfo) {
321
325
} else if ( [ `statement` , `update` ] . includes ( statementDetail . qualifier ) ) {
322
326
// If it's a basic statement, we can let it scroll!
323
327
if ( statementDetail . noUi ) {
328
+ setCancelButtonVisibility ( true ) ;
324
329
chosenView . setLoadingText ( `Running SQL statement... (${ possibleTitle } )` , false ) ;
325
330
await JobManager . runSQL ( statementDetail . content , undefined , 1 ) ;
326
331
@@ -460,6 +465,10 @@ async function runHandler(options?: StatementInfo) {
460
465
}
461
466
}
462
467
468
+ if ( options . noUi ) {
469
+ setCancelButtonVisibility ( false ) ;
470
+ }
471
+
463
472
updateStatusBar ( ) ;
464
473
}
465
474
}
0 commit comments