diff --git a/packages/fx-core/src/plugins/resource/frontend/ops/provision.ts b/packages/fx-core/src/plugins/resource/frontend/ops/provision.ts index edabf3086c..c46c7256db 100644 --- a/packages/fx-core/src/plugins/resource/frontend/ops/provision.ts +++ b/packages/fx-core/src/plugins/resource/frontend/ops/provision.ts @@ -46,7 +46,7 @@ export class FrontendProvision { } public static setTabScope(ctx: PluginContext, variables: ManifestVariables): void { - const tabScope = ctx.answers?.getString(QuestionKey.TabScope); + const tabScope = ctx.config.getString(QuestionKey.TabScope); // Always overwrite these configs to support both local debug and remote debug ctx.config.set(FrontendConfigInfo.ConfigurableTab, TabScopeManifest.getConfigurableTab(variables, tabScope)); ctx.config.set(FrontendConfigInfo.StaticTab, TabScopeManifest.getStaticTab(variables, tabScope)); diff --git a/packages/fx-core/src/plugins/resource/frontend/plugin.ts b/packages/fx-core/src/plugins/resource/frontend/plugin.ts index d185e61f2f..6821a8ce05 100644 --- a/packages/fx-core/src/plugins/resource/frontend/plugin.ts +++ b/packages/fx-core/src/plugins/resource/frontend/plugin.ts @@ -31,7 +31,7 @@ import { Messages } from "./resources/messages"; import { FrontendScaffold as Scaffold, TemplateInfo } from "./ops/scaffold"; import { TeamsFxResult } from "./error-factory"; import { PreDeploySteps, ProgressHelper, ProvisionSteps, ScaffoldSteps } from "./utils/progress-helper"; -import { tabScopeQuestion } from "./resources/questions"; +import { QuestionKey, TabScope, tabScopeQuestion } from "./resources/questions"; import { ManifestVariables } from "./resources/tabScope"; export class FrontendPluginImpl { @@ -68,6 +68,9 @@ export class FrontendPluginImpl { templateInfo.scenario = FrontendPluginInfo.TemplateWithFunctionScenario; } + const tabScope = ctx.answers?.getString(QuestionKey.TabScope) ?? TabScope.PersonalTab; + this.setConfigIfNotExists(ctx, QuestionKey.TabScope, tabScope); + const zip = await runWithErrorCatchAndThrow( new GetTemplateError(), async () => await Scaffold.getTemplateZip(ctx, templateInfo),