Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change CustomerDocument to UseCustomerValidateTokenDocument #2445

Open
wants to merge 2 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/early-taxis-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/magento-customer': patch
---

fix session expired email not always available in cache
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import { Trans } from '@lingui/react'
import type { SxProps, Theme } from '@mui/material'
import { Alert, Box, CircularProgress, Link, Typography } from '@mui/material'
import { useRouter } from 'next/router'
import { CustomerDocument, useAccountSignInUpForm, useCustomerAccountCanSignUp } from '../../hooks'
import {
CustomerDocument,
useAccountSignInUpForm,
useCustomerAccountCanSignUp,
UseCustomerValidateTokenDocument,
} from '../../hooks'
import { useCustomerQuery } from '../../hooks/useCustomerQuery'
import { ApolloCustomerErrorAlert } from '../ApolloCustomerError'
import { SignInForm } from '../SignInForm/SignInForm'
Expand All @@ -30,9 +35,11 @@ const { classes } = extendableComponent('AccountSignInUpForm', parts)

export function AccountSignInUpForm(props: AccountSignInUpFormProps) {
const { sx = [], signUpDisabled } = props
const customerEmailQuery = useCustomerQuery(UseCustomerValidateTokenDocument)
const customerQuery = useCustomerQuery(CustomerDocument)

const { email, firstname = '' } = customerQuery.data?.customer ?? {}
const { email } = customerEmailQuery.data?.customer ?? {}
const { firstname = '' } = customerQuery.data?.customer ?? {}

const { mode, form, submit } = useAccountSignInUpForm()
const { formState, watch, control, error } = form
Expand Down
1 change: 1 addition & 0 deletions packages/magento-customer/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export * from './useAccountSignInUpForm'
export * from './useCustomerPermissions'
export * from './useCustomerQuery'
export * from './useCustomerSession'
export * from './UseCustomerValidateToken.gql'
export * from './useGuestQuery'
export { default as useOrderCardItemImages } from './useOrderCardItemImages'
export * from './useSignInForm'
Loading