From 74ec4c75d63096836d2a1f5d384d5b2552f41d37 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Thu, 25 Jan 2024 15:26:00 +0800 Subject: [PATCH 1/2] fix registration not working --- src/pages/authentication/auth-forms/BusCustomFormWizard.js | 2 +- src/pages/authentication/auth-forms/CustomFormWizard.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index 641b9ec..d7f0149 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -323,7 +323,7 @@ const BusCustomFormWizard = (props) => { const { handleSubmit } = useForm({}) const _onSubmit = () => { setLoding(true); - values.address4 = selectedAddress4.key + values.address4 = selectedAddress4==null?"":selectedAddress4.key values.address5 = selectedAddress5.key // console.log(values) const busUserAddress = { diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 2d8604a..b42bda4 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -89,7 +89,7 @@ const CustomFormWizard = (props) => { const [selectedIdDocInputType, setSelectedIdDocInputType] = useState(""); // const [selectedIdDocLabel, setSelectedIdDocLabel] = useState(null); const [selectedAddress4, setSelectedAddress4] = useState(null); - console.log(ComboData.country[0]); + // console.log(ComboData.country[0]); const [selectedAddress5, setSelectedAddress5] = useState(ComboData.country[0]); const [termsAndConAccept, setTermsAndConAccept] = useState(false); const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false); @@ -314,8 +314,9 @@ const CustomFormWizard = (props) => { const _onSubmit = () => { setLoding(true); values.idDocType = selectedIdDocType.type - values.address4 = selectedAddress4.key + values.address4 = selectedAddress4==null?"":selectedAddress4.key values.address5 = selectedAddress5.key + console.log(values) const userAddress = { "addressLine1": "", "addressLine2": "", From 704c0cb9243d41593b9c5ec9bbb2e1fbf67b2ab0 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Thu, 25 Jan 2024 18:00:41 +0800 Subject: [PATCH 2/2] test iamsmart user token not work --- src/components/AutoLogoutProvider.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/AutoLogoutProvider.js b/src/components/AutoLogoutProvider.js index e48747d..b8891c0 100644 --- a/src/components/AutoLogoutProvider.js +++ b/src/components/AutoLogoutProvider.js @@ -1,8 +1,8 @@ import React, { createContext, useState, useEffect } from 'react'; import {useNavigate} from "react-router-dom"; //import axios from "axios"; -import {getUserData} from "../auth/utils"; -import {isObjEmpty} from "../utils/Utils"; +// import {getUserData} from "../auth/utils"; +// import {isObjEmpty} from "../utils/Utils"; import {useIdleTimer} from "react-idle-timer"; import { handleLogoutFunction } from 'auth/index'; import { useDispatch } from "react-redux"; @@ -52,8 +52,8 @@ const AutoLogoutProvider = ({ children }) => { //const tabId = getTabId() === null ? 'loading' : getTabId().toString() useEffect(() => { - const userData = getUserData(); - if(!isObjEmpty(userData)){ + // const userData = getUserData(); + if(isUserLoggedIn()){ //TODO: get auto logout time here if(isGLDLoggedIn()){ setLogoutInterval(240);