Skip to content

Commit

Permalink
fix: Leaving import in middle during review step not asking for confi…
Browse files Browse the repository at this point in the history
…rmation
  • Loading branch information
chavda-bhavik committed Sep 11, 2024
1 parent 1bb08aa commit 121d395
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions apps/widget/src/components/widget/Widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ export function Widget() {
setPromptContinueAction(undefined);
};
const onClose = () => {
if (
[
let isImportNotOnProgress = false;
if (importConfig.mode === TemplateModeEnum.AUTOMATIC)
isImportNotOnProgress = [PhasesEnum.CONFIGURE, PhasesEnum.CONFIRM].includes(phase);
else
isImportNotOnProgress = [
PhasesEnum.VALIDATE,
PhasesEnum.IMAGE_UPLOAD,
PhasesEnum.UPLOAD,
PhasesEnum.COMPLETE,
PhasesEnum.CONFIRM,
].includes(phase)
) {
].includes(phase);

if (isImportNotOnProgress) {
setPhase(PhasesEnum.VALIDATE);
resetAppState();
closeWidget();
Expand Down

0 comments on commit 121d395

Please sign in to comment.