From 2dd7fee1cbb0da61af40402698008fa1de109f29 Mon Sep 17 00:00:00 2001 From: SektorDV <35644259+SektorDV@users.noreply.github.com> Date: Fri, 3 Sep 2021 13:22:19 +0200 Subject: [PATCH] Enforce category selection in product creator (#1337) --- 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 a0be300fc24..3351517338f 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,