@graphcommerce/magento-cart 8.1.0-canary.16 → 8.1.0-canary.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.1.0-canary.18
4
+
5
+ ## 8.1.0-canary.17
6
+
3
7
  ## 8.1.0-canary.16
4
8
 
5
9
  ## 8.1.0-canary.15
@@ -12,7 +12,7 @@ export function useFormGqlMutationCart<
12
12
  V extends { cartId: string; [index: string]: unknown },
13
13
  >(
14
14
  document: TypedDocumentNode<Q, V>,
15
- options: UseFormGraphQlOptions<Q, V> = {},
15
+ options: UseFormGraphQlOptions<Q, V> & { submitWhileLocked?: boolean } = {},
16
16
  operationOptions?: MutationHookOptions<Q, V>,
17
17
  ): UseFormGqlMutationReturn<Q, V> {
18
18
  const cartId = useCartIdCreate()
@@ -26,7 +26,11 @@ export function useFormGqlMutationCart<
26
26
  const vars = { ...variables, cartId: await cartId() }
27
27
 
28
28
  const res = client.cache.readQuery({ query: CurrentCartIdDocument })
29
- if (res?.currentCartId?.locked) return false
29
+ if (!options.submitWhileLocked && res?.currentCartId?.locked) {
30
+ console.log('Could not submit form, cart is locked', res.currentCartId.locked)
31
+ return false
32
+ }
33
+
30
34
  return options.onBeforeSubmit ? options.onBeforeSubmit(vars) : vars
31
35
  },
32
36
  },
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.1.0-canary.16",
5
+ "version": "8.1.0-canary.18",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,20 +12,20 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^8.1.0-canary.16",
16
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.16",
17
- "@graphcommerce/framer-next-pages": "^8.1.0-canary.16",
18
- "@graphcommerce/framer-scroller": "^8.1.0-canary.16",
19
- "@graphcommerce/framer-utils": "^8.1.0-canary.16",
20
- "@graphcommerce/graphql": "^8.1.0-canary.16",
21
- "@graphcommerce/image": "^8.1.0-canary.16",
22
- "@graphcommerce/magento-customer": "^8.1.0-canary.16",
23
- "@graphcommerce/magento-graphql": "^8.1.0-canary.16",
24
- "@graphcommerce/magento-store": "^8.1.0-canary.16",
25
- "@graphcommerce/next-ui": "^8.1.0-canary.16",
26
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.16",
27
- "@graphcommerce/react-hook-form": "^8.1.0-canary.16",
28
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.16",
15
+ "@graphcommerce/ecommerce-ui": "^8.1.0-canary.18",
16
+ "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.18",
17
+ "@graphcommerce/framer-next-pages": "^8.1.0-canary.18",
18
+ "@graphcommerce/framer-scroller": "^8.1.0-canary.18",
19
+ "@graphcommerce/framer-utils": "^8.1.0-canary.18",
20
+ "@graphcommerce/graphql": "^8.1.0-canary.18",
21
+ "@graphcommerce/image": "^8.1.0-canary.18",
22
+ "@graphcommerce/magento-customer": "^8.1.0-canary.18",
23
+ "@graphcommerce/magento-graphql": "^8.1.0-canary.18",
24
+ "@graphcommerce/magento-store": "^8.1.0-canary.18",
25
+ "@graphcommerce/next-ui": "^8.1.0-canary.18",
26
+ "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.18",
27
+ "@graphcommerce/react-hook-form": "^8.1.0-canary.18",
28
+ "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.18",
29
29
  "@lingui/core": "^4.2.1",
30
30
  "@lingui/macro": "^4.2.1",
31
31
  "@lingui/react": "^4.2.1",