Skip to content

Commit 2820d1f

Browse files
committed
store: Clear the store when the Wizard is closed
This clears the wizard state and resets the modal store when the Wizard is closed.
1 parent fd20e4e commit 2820d1f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Components/CreateImageWizard3/CreateImageWizard3.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export const CreateImageWizard3 = () => {
188188

189189
const handleClose = () => {
190190
dispatch(closeWizardModal());
191+
dispatch(initializeWizard());
191192

192193
if (
193194
searchParams.has('release') ||

src/store/slices/wizardModal/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export const wizardModalSlice = createSlice({
2929
state.isModalOpen = true;
3030
state.mode = action.payload;
3131
},
32-
closeWizardModal: (state) => {
33-
state.isModalOpen = false;
32+
closeWizardModal: () => {
33+
return initialState;
3434
},
3535
},
3636
});

0 commit comments

Comments
 (0)