Skip to content

Commit

Permalink
fix: exception in dispose (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
veredcon authored Mar 20, 2024
1 parent 72a720c commit 594b874
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions packages/backend/src/panels/AbstractWebviewPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,19 @@ export abstract class AbstractWebviewPanel {
// When user clicks "Finish" the generated has ended and the success/failure result will be set in "GENERATOR_COMPLETED".
// If it has not been ended, "GENERATOR_COMPLETED" will be undefined.
if (yeomanui && isGeneratorCompleted === undefined) {
const promptItems: any = get(yeomanui, "gen.prompts.items") ?? [];
const currentPromptCount = yeomanui.promptCount;
const numOfPromopts = promptItems.length;
const wizardStepName = promptItems[currentPromptCount - 1].name;
AnalyticsWrapper.updateGeneratorClosedManually(
yeomanui.generatorName ?? "",
wizardStepName,
currentPromptCount,
numOfPromopts,
this.logger,
);
const promptItems: any = get(yeomanui, "gen.prompts.items");
if (promptItems) {
const currentPromptCount = yeomanui.promptCount;
const numOfPromopts = promptItems.length;
const wizardStepName = promptItems[currentPromptCount - 1]?.name;
AnalyticsWrapper.updateGeneratorClosedManually(
yeomanui.generatorName ?? "",
wizardStepName,
currentPromptCount,
numOfPromopts,
this.logger,
);
}
}

// Clean up our resources
Expand Down

0 comments on commit 594b874

Please sign in to comment.