File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
packages/template-retail-react-app/app/pages/login Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,6 @@ const Login = ({initialView = LOGIN_VIEW}) => {
7575 const [ currentView , setCurrentView ] = useState ( initialView )
7676 const [ passwordlessLoginEmail , setPasswordlessLoginEmail ] = useState ( '' )
7777 const [ loginType , setLoginType ] = useState ( LOGIN_TYPES . PASSWORD )
78- let locatedFrom
7978
8079 const handleMergeBasket = ( ) => {
8180 const hasBasketItem = baskets ?. baskets ?. [ 0 ] ?. productItems ?. length > 0
@@ -110,8 +109,6 @@ const Login = ({initialView = LOGIN_VIEW}) => {
110109
111110 const handlePasswordlessLogin = async ( email ) => {
112111 try {
113- // Save the path where the user logged in
114- window . localStorage . setItem ( 'returnToPage' , window . location . pathname )
115112 await authorizePasswordlessLogin . mutateAsync ( { userid : email } )
116113 setCurrentView ( EMAIL_VIEW )
117114 } catch ( error ) {
@@ -173,7 +170,7 @@ const Login = ({initialView = LOGIN_VIEW}) => {
173170 useEffect ( ( ) => {
174171 if ( isRegistered ) {
175172 handleMergeBasket ( )
176- locatedFrom = window . localStorage . getItem ( 'returnToPage' )
173+ const locatedFrom = window . localStorage . getItem ( 'returnToPage' )
177174 if ( locatedFrom ) {
178175 navigate ( locatedFrom )
179176 } else {
You can’t perform that action at this time.
0 commit comments