@@ -8,7 +8,7 @@ import React from 'react';
88import { Plan } from '../../entities/plan.js' ;
99import { ResourceConfig } from '../../entities/resource-config.js' ;
1010import { ResourceInfo } from '../../entities/resource-info.js' ;
11- import { Event , ProcessName , SubProcessName , ctx } from '../../events/context.js' ;
11+ import { ctx , Event , ProcessName , SubProcessName } from '../../events/context.js' ;
1212import { FileModificationResult } from '../../generators/index.js' ;
1313import { ImportResult } from '../../orchestrators/import.js' ;
1414import { sleep } from '../../utils/index.js' ;
@@ -332,7 +332,7 @@ export class DefaultReporter implements Reporter {
332332
333333 while ( attemptCount < 3 ) {
334334 const result = ( await Promise . all ( [
335- this . updateRenderState ( RenderStatus . SUDO_PROMPT , attemptCount ) ,
335+ this . updateRenderState ( RenderStatus . SUDO_PROMPT , { attemptCount, cancellable : true } ) ,
336336 Promise . race ( [
337337 this . awaitEvent < string > ( RenderEvent . SUDO_PROMPT_RESULT ) ,
338338 this . awaitEvent < 'cancel' > ( RenderEvent . SUDO_PASSWORD_CANCEL ) . then ( ( ) => Symbol . for ( 'cancel' ) ) ,
@@ -372,9 +372,12 @@ export class DefaultReporter implements Reporter {
372372 private async getUserPassword ( ) : Promise < string > {
373373 let attemptCount = 0 ;
374374
375+ this . updateRenderState ( RenderStatus . NOTHING ) ;
376+ await sleep ( 50 ) ;
377+
375378 while ( attemptCount < 3 ) {
376379 const passwordAttempt = await this . updateStateAndAwaitEvent < string > (
377- ( ) => this . updateRenderState ( RenderStatus . SUDO_PROMPT , attemptCount ) ,
380+ ( ) => this . updateRenderState ( RenderStatus . SUDO_PROMPT , { attemptCount, cancellable : false } ) ,
378381 RenderEvent . SUDO_PROMPT_RESULT ,
379382 ) ;
380383
0 commit comments