Skip to content

Commit

Permalink
fix: fix translation, replace useWatch with watch
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni-Schroevers committed Dec 9, 2024
1 parent f1473f3 commit cca7a52
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-bears-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/magento-customer': patch
---

Replace useWatch with watch in order to prevent email from being undefinded when already being prefilled for expired sessions
2 changes: 1 addition & 1 deletion examples/magento-graphcms/locales/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ msgstr "Cela supprimera toutes vos données, y compris l'historique des commande

#. js-lingui-generated-id
msgid "{0, plural, one {<0>{addedItems}</0> has been added to your shopping cart} two {<1>{addedItems}</1> have been added to your shopping cart!} other {# products have been added to your shopping cart!}}"
msgstr "{0, plural, one {<0>{éléments ajoutés}</0> a été ajouté à votre panier} two {<1>{éléments ajoutés}</1> ont été ajoutés à votre panier!} other {# produits ont été ajoutés à votre panier!}}"
msgstr "{0, plural, one {<0>{addedItems}</0> a été ajouté à votre panier} two {<1>{addedItems}</1> ont été ajoutés à votre panier!} other {# produits ont été ajoutés à votre panier!}}"

#. js-lingui-generated-id
msgid "I understand that my account will be deleted and this can not be undone."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
ActionCardListForm,
EmailElement,
FormAutoSubmit,
useWatch,
} from '@graphcommerce/ecommerce-ui'
import { ActionCardListForm, EmailElement, FormAutoSubmit } from '@graphcommerce/ecommerce-ui'
import { useApolloClient } from '@graphcommerce/graphql'
import {
ActionCard,
Expand Down Expand Up @@ -40,7 +35,7 @@ export function AccountSignInUpForm(props: AccountSignInUpFormProps) {
const { email, firstname = '' } = customerQuery.data?.customer ?? {}

const { mode, form, submit } = useAccountSignInUpForm()
const { formState, control, error, setError, clearErrors } = form
const { formState, control, error, setError, clearErrors, watch } = form
const router = useRouter()

const client = useApolloClient()
Expand All @@ -54,7 +49,7 @@ export function AccountSignInUpForm(props: AccountSignInUpFormProps) {
mode === 'signin' ||
(mode === 'signup' && canSignUp)

const emailValue = useWatch({ control }).email
const emailValue = watch('email')

return (
<FormDiv sx={sx} className={classes.root}>
Expand Down

0 comments on commit cca7a52

Please sign in to comment.