@@ -18,7 +18,7 @@ import { getWorkspaceSetting, updateWorkspaceSetting } from '../../vsCodeConfig/
1818import { FunctionSubWizard } from './FunctionSubWizard' ;
1919import { type IFunctionWizardContext } from './IFunctionWizardContext' ;
2020import { JobsListStep } from './JobsListStep' ;
21- import { DurableStorageTypePromptStep } from './durableSteps/DurableStorageTypePromptStep' ;
21+ import { DurableStorageTypeListStep } from './durableSteps/DurableStorageTypePromptStep' ;
2222
2323export class FunctionListStep extends AzureWizardPromptStep < IFunctionWizardContext > {
2424 public hideStepCount : boolean = true ;
@@ -66,17 +66,20 @@ export class FunctionListStep extends AzureWizardPromptStep<IFunctionWizardConte
6666 }
6767
6868 public async getSubWizard ( context : IFunctionWizardContext ) : Promise < IWizardOptions < IFunctionWizardContext > | undefined > {
69+ const requiresDurableStorageSetup : boolean = durableUtils . requiresDurableStorageSetup ( context ) ;
70+
6971 if ( context . functionTemplate ?. templateSchemaVersion === TemplateSchemaVersion . v2 ) {
70- return { promptSteps : [ new JobsListStep ( this . _isProjectWizard ) ] } ;
72+ return requiresDurableStorageSetup ?
73+ { promptSteps : [ new DurableStorageTypeListStep ( ) , new JobsListStep ( this . _isProjectWizard ) ] } :
74+ { promptSteps : [ new JobsListStep ( this . _isProjectWizard ) ] } ;
7175 }
7276
73- const requiresDurableStorageSetup : boolean = durableUtils . requiresDurableStorageSetup ( context ) ;
77+ const { promptSteps = [ ] , executeSteps = [ ] } = await FunctionSubWizard . createSubWizard ( context , this . _functionSettings , this . _isProjectWizard ) ?? { promptSteps : [ ] , executeSteps : [ ] } ;
7478 if ( requiresDurableStorageSetup ) {
75- return { promptSteps : [ new DurableStorageTypePromptStep ( ) ] } ;
76- } else {
77- return await FunctionSubWizard . createSubWizard ( context , this . _functionSettings , this . _isProjectWizard ) ;
79+ promptSteps . unshift ( new DurableStorageTypeListStep ( ) ) ;
7880 }
7981
82+ return { promptSteps, executeSteps } ;
8083 }
8184
8285 public async prompt ( context : IFunctionWizardContext ) : Promise < void > {
0 commit comments