Skip to content

Commit

Permalink
fix(page type): Fix problem when closing modals after creating a page…
Browse files Browse the repository at this point in the history
… type
  • Loading branch information
xrutayisire committed Oct 16, 2023
1 parent eada429 commit 5109401
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,14 @@ const SliceZone: React.FC<SliceZoneProps> = ({

const closeUpdateSliceZoneModal = () => {
setIsUpdateSliceZoneModalOpen(false);
redirectToEditMode();
};

const closeCreateSliceModal = () => {
setIsCreateSliceModalOpen(false);
redirectToEditMode();
};

const closeSlicesTemplatesModal = () => {
setIsSlicesTemplatesModalOpen(false);
redirectToEditMode();
};

const onAddSlicesToSliceZone = (newCustomType: CustomTypeSM) => {
Expand Down Expand Up @@ -311,6 +308,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
});
onAddSlicesToSliceZone(newCustomType);
closeUpdateSliceZoneModal();
redirectToEditMode();
toast.success("Slice(s) added to slice zone");
}}
close={closeUpdateSliceZoneModal}
Expand All @@ -328,6 +326,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
});
onAddSlicesToSliceZone(newCustomType);
closeSlicesTemplatesModal();
redirectToEditMode();
toast.success(
<ToastMessageWithPath
message="Slice template(s) added to slice zone and created at: "
Expand Down Expand Up @@ -357,6 +356,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
});
onAddSlicesToSliceZone(newCustomType);
closeCreateSliceModal();
redirectToEditMode();
toast.success(
<ToastMessageWithPath
message="New slice added to slice zone and created at: "
Expand Down

0 comments on commit 5109401

Please sign in to comment.