ソースを参照

Unify loading state

Rares Capilnar 2 年 前
コミット
d8ce13c351

+ 4 - 1
src/admin/components/onboarding-flow/products/products-list.tsx

@@ -12,9 +12,12 @@ enum ProductStatus {
 const ProductsList = ({ onNext, isComplete }: StepContentProps) => {
   const { mutateAsync: createCollection, isLoading: collectionLoading } =
     useAdminCreateCollection();
-  const { mutateAsync: createProduct, isLoading } = useAdminCreateProduct();
+  const { mutateAsync: createProduct, isLoading: productLoading } =
+    useAdminCreateProduct();
   const { regions } = useAdminRegions();
 
+  const isLoading = collectionLoading || productLoading;
+
   const createSample = async () => {
     try {
       const { collection } = await createCollection({