@graphcommerce/magento-customer 8.0.1-canary.3 → 8.0.1

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,28 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2177](https://github.com/graphcommerce-org/graphcommerce/pull/2177) [`816d789`](https://github.com/graphcommerce-org/graphcommerce/commit/816d7893159528bbe4ffc51c3958c806b81b58b0) - Change sorting for customer orders in Descending Created at order
8
+ ([@LaurensFranken](https://github.com/LaurensFranken))
9
+
10
+ - [#2191](https://github.com/graphcommerce-org/graphcommerce/pull/2191) [`13ffa6b`](https://github.com/graphcommerce-org/graphcommerce/commit/13ffa6b945f1c72bf1fdc9298e4ce5dd76b48d73) - When a user was logging in from the checkout react would be caught in an infinite loop and thus the page would hang
11
+ ([@JoshuaS98](https://github.com/JoshuaS98))
12
+
13
+ - [#2187](https://github.com/graphcommerce-org/graphcommerce/pull/2187) [`09a2cc3`](https://github.com/graphcommerce-org/graphcommerce/commit/09a2cc35ceb5e714ffd02e573eebe7de842ae327) - Do not try to automatically invalidate the current token and fully rely on the Session Expired dialog
14
+ ([@paales](https://github.com/paales))
15
+
16
+ - [#2187](https://github.com/graphcommerce-org/graphcommerce/pull/2187) [`ee969bf`](https://github.com/graphcommerce-org/graphcommerce/commit/ee969bfc5415392747b04e0484685f5c611a2559) - After signing out the currentCartId was still returning a value causing the cart to be shown after signing out
17
+ ([@paales](https://github.com/paales))
18
+
19
+ ## 8.0.1-canary.4
20
+
21
+ ### Patch Changes
22
+
23
+ - [#2191](https://github.com/graphcommerce-org/graphcommerce/pull/2191) [`13ffa6b`](https://github.com/graphcommerce-org/graphcommerce/commit/13ffa6b945f1c72bf1fdc9298e4ce5dd76b48d73) - When a user was logging in from the checkout react would be caught in an infinite loop and thus the page would hang
24
+ ([@JoshuaS98](https://github.com/JoshuaS98))
25
+
3
26
  ## 8.0.1-canary.3
4
27
 
5
28
  ## 8.0.1-canary.2
@@ -10,6 +10,7 @@ import {
10
10
  IsEmailAvailableQueryVariables,
11
11
  } from './IsEmailAvailable.gql'
12
12
  import { useCustomerSession } from './useCustomerSession'
13
+ import { useUrlQuery } from '@graphcommerce/next-ui'
13
14
 
14
15
  export type UseFormIsEmailAvailableProps = {
15
16
  onSubmitted?: (data: { email: string }) => void
@@ -22,6 +23,7 @@ export const isToggleMethod = !import.meta.graphCommerce.enableGuestCheckoutLogi
22
23
  export function useAccountSignInUpForm(props: UseFormIsEmailAvailableProps = {}) {
23
24
  const { onSubmitted } = props
24
25
  const { token, valid } = useCustomerSession()
26
+ const [queryState, setRouterQuery] = useUrlQuery<{ email?: string | null }>()
25
27
 
26
28
  const customerQuery = useQuery(CustomerDocument, { fetchPolicy: 'cache-only' })
27
29
  const cachedEmail = customerQuery?.data?.customer?.email
@@ -39,19 +41,20 @@ export function useAccountSignInUpForm(props: UseFormIsEmailAvailableProps = {})
39
41
  },
40
42
  { fetchPolicy: 'cache-and-network' },
41
43
  )
42
- const { formState, data, handleSubmit } = form
44
+ const { formState, data, handleSubmit, setValue, trigger } = form
43
45
  const { isSubmitSuccessful, isValid } = formState
44
46
 
45
- const router = useRouter()
46
47
  useEffect(() => {
47
- const emailFromParams = router.query.email as string
48
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
49
+ ;(async () => {
50
+ if (!cachedEmail && queryState.email) {
51
+ await setRouterQuery({ email: null })
48
52
 
49
- if (!cachedEmail && emailFromParams) {
50
- form.setValue('email', emailFromParams)
51
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
52
- form.trigger('email')
53
- }
54
- }, [cachedEmail, router.query.email, form])
53
+ setValue('email', queryState.email)
54
+ await trigger('email')
55
+ }
56
+ })()
57
+ }, [cachedEmail, queryState.email, setRouterQuery, setValue, trigger])
55
58
 
56
59
  const submit = isToggleMethod
57
60
  ? async (e?: React.BaseSyntheticEvent) => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-customer",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.0.1-canary.3",
5
+ "version": "8.0.1",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,19 +12,19 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^8.0.1-canary.3",
16
- "@graphcommerce/eslint-config-pwa": "^8.0.1-canary.3",
17
- "@graphcommerce/framer-next-pages": "^8.0.1-canary.3",
18
- "@graphcommerce/framer-utils": "^8.0.1-canary.3",
19
- "@graphcommerce/graphql": "^8.0.1-canary.3",
20
- "@graphcommerce/graphql-mesh": "^8.0.1-canary.3",
21
- "@graphcommerce/image": "^8.0.1-canary.3",
22
- "@graphcommerce/magento-graphql": "^8.0.1-canary.3",
23
- "@graphcommerce/magento-store": "^8.0.1-canary.3",
24
- "@graphcommerce/next-ui": "^8.0.1-canary.3",
25
- "@graphcommerce/prettier-config-pwa": "^8.0.1-canary.3",
26
- "@graphcommerce/react-hook-form": "^8.0.1-canary.3",
27
- "@graphcommerce/typescript-config-pwa": "^8.0.1-canary.3",
15
+ "@graphcommerce/ecommerce-ui": "^8.0.1",
16
+ "@graphcommerce/eslint-config-pwa": "^8.0.1",
17
+ "@graphcommerce/framer-next-pages": "^8.0.1",
18
+ "@graphcommerce/framer-utils": "^8.0.1",
19
+ "@graphcommerce/graphql": "^8.0.1",
20
+ "@graphcommerce/graphql-mesh": "^8.0.1",
21
+ "@graphcommerce/image": "^8.0.1",
22
+ "@graphcommerce/magento-graphql": "^8.0.1",
23
+ "@graphcommerce/magento-store": "^8.0.1",
24
+ "@graphcommerce/next-ui": "^8.0.1",
25
+ "@graphcommerce/prettier-config-pwa": "^8.0.1",
26
+ "@graphcommerce/react-hook-form": "^8.0.1",
27
+ "@graphcommerce/typescript-config-pwa": "^8.0.1",
28
28
  "@lingui/core": "^4.2.1",
29
29
  "@lingui/macro": "^4.2.1",
30
30
  "@lingui/react": "^4.2.1",