Skip to content

Commit

Permalink
STUD-203: Reset consentsToContract field to false when navigating back (
Browse files Browse the repository at this point in the history
  • Loading branch information
escobarjonatan authored Mar 28, 2024
1 parent 9cff52c commit d9f54f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/studio/src/pages/home/uploadSong/ConfirmAgreement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useFormikContext } from "formik";
import { Box, useTheme } from "@mui/material";
import { useWindowDimensions } from "@newm-web/utils";
import { Button, Typography } from "@newm-web/elements";
import { FunctionComponent, useState } from "react";
import { FunctionComponent, useEffect, useState } from "react";
import PriceSummaryDialog from "./PriceSummaryDialog";
import { UploadSongThunkRequest } from "../../../modules/song";
import { ConfirmContract } from "../../../components";
Expand Down Expand Up @@ -32,6 +32,13 @@ const ConfirmAgreement: FunctionComponent<ConfirmAgreementProps> = ({
}
};

// Reset consent to contract when unmounting
useEffect(() => {
return () => {
setFieldValue("consentsToContract", false);
};
}, [setFieldValue]);

return (
<Box marginX={ ["auto", "auto", "unset"] } maxWidth={ "500px" }>
<Typography mb={ 1.5 }>
Expand Down

0 comments on commit d9f54f7

Please sign in to comment.