From 9b2f5e3db2379d47f1ed8b089c9435b3e18d9cc6 Mon Sep 17 00:00:00 2001 From: Jakub Majorek Date: Fri, 3 Sep 2021 13:40:06 +0200 Subject: [PATCH] Enforce category selection in product creator (#1337) (#1354) Co-authored-by: SektorDV <35644259+SektorDV@users.noreply.github.com> --- src/products/components/ProductCreatePage/form.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/products/components/ProductCreatePage/form.tsx b/src/products/components/ProductCreatePage/form.tsx index a0be300fc..335151733 100644 --- a/src/products/components/ProductCreatePage/form.tsx +++ b/src/products/components/ProductCreatePage/form.tsx @@ -174,7 +174,6 @@ function useProductCreateForm( trackInventory: false, weight: "" }; - const [changed, setChanged] = React.useState(false); const triggerChange = () => setChanged(true); @@ -312,7 +311,8 @@ function useProductCreateForm( data.channelListings.some( channel => validatePrice(channel.price) || validateCostPrice(channel.costPrice) - )); + ) || + !data.category); return { change: handleChange,