Skip to content

Commit cd4c739

Browse files
committed
next/store/course: fix form state when switching tabs
1 parent 8d0dba9 commit cd4c739

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/packages/next/components/store/site-license.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ export default function SiteLicense({ noAccount, source }: Props) {
9090
{router.query.id != null
9191
? "Edit License in Shopping Cart"
9292
: source === "course"
93-
? "Purchase a License for a Course"
94-
: "Configure a License"}
93+
? "Purchase a License for a Course"
94+
: "Configure a License"}
9595
</Title>
9696
{router.query.id == null && (
9797
<>
@@ -385,6 +385,11 @@ function CreateSiteLicense({
385385
}
386386
}, [source, router.asPath]);
387387

388+
// Update the form source field when the source prop changes
389+
useEffect(() => {
390+
form.setFieldValue("source", source);
391+
}, [source]);
392+
388393
if (loading) {
389394
return <Loading large center />;
390395
}

0 commit comments

Comments
 (0)