Skip to content

Commit d7ae8d6

Browse files
committed
PWA-3233 : Unable to sign-In using TAB/ Mouse Click button from Sign
2 parents fb7d5aa + 4108b61 commit d7ae8d6

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

packages/peregrine/lib/talons/SignIn/useSignIn.js

+10-19
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import { useCartContext } from '../../context/cart';
77
import { useUserContext } from '../../context/user';
88
import { useAwaitQuery } from '../../hooks/useAwaitQuery';
99
import { retrieveCartId } from '../../store/actions/cart';
10-
import { useDropdown } from '@magento/peregrine/lib/hooks/useDropdown';
1110

1211
import DEFAULT_OPERATIONS from './signIn.gql';
1312
import { useEventingContext } from '../../context/eventing';
1413

1514
export const useSignIn = props => {
1615
const {
16+
handleTriggerClick,
1717
getCartDetailsQuery,
1818
setDefaultUsername,
1919
showCreateAccount,
@@ -64,18 +64,11 @@ export const useSignIn = props => {
6464
const formApiRef = useRef(null);
6565
const setFormApi = useCallback(api => (formApiRef.current = api), []);
6666

67-
const { setExpanded: setCurrencyMenuIsOpen } = useDropdown();
68-
69-
const handleTrigger = useCallback(() => {
70-
// Toggle Stores Menu.
71-
setCurrencyMenuIsOpen(isOpen => !isOpen);
72-
}, [setCurrencyMenuIsOpen]);
73-
7467
const handleSubmit = useCallback(
7568
async ({ email, password }) => {
7669
setIsSigningIn(true);
7770
handleTrigger();
78-
71+
7972
try {
8073
// Get source cart id (guest cart id).
8174
const sourceCartId = cartId;
@@ -106,15 +99,13 @@ export const useSignIn = props => {
10699
});
107100
const destinationCartId = await retrieveCartId();
108101

109-
if (destinationCartId != sourceCartId) {
110-
// Merge the guest cart into the customer cart.
111-
await mergeCarts({
112-
variables: {
113-
destinationCartId,
114-
sourceCartId
115-
}
116-
});
117-
}
102+
// Merge the guest cart into the customer cart.
103+
await mergeCarts({
104+
variables: {
105+
destinationCartId,
106+
sourceCartId
107+
}
108+
});
118109

119110
// Ensure old stores are updated with any new data.
120111

@@ -155,7 +146,7 @@ export const useSignIn = props => {
155146
getCartDetails,
156147
fetchCartDetails,
157148
dispatch,
158-
handleTrigger
149+
handleTriggerClick
159150
]
160151
);
161152

0 commit comments

Comments
 (0)