| @@ -8,10 +8,8 @@ import { | |||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import * as React from "react"; | import * as React from "react"; | ||||
| import * as HttpUtils from "utils/HttpUtils"; | import * as HttpUtils from "utils/HttpUtils"; | ||||
| // import FpsIcon from "assets/images/icons/fps.svg"; | |||||
| import { useNavigate } from 'react-router-dom'; | |||||
| //import { useNavigate } from 'react-router-dom'; | |||||
| import { paymentPath } from "auth/utils"; | import { paymentPath } from "auth/utils"; | ||||
| // import {poll} from "utils/Utils"; | |||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | ||||
| @@ -30,7 +28,7 @@ const BackgroundHead = { | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| const Index = () => { | const Index = () => { | ||||
| const navigate = useNavigate() | |||||
| //const navigate = useNavigate() | |||||
| const [responeData, setResponeDataData] = React.useState({}); | const [responeData, setResponeDataData] = React.useState({}); | ||||
| const [transactionData, setTransactionData] = React.useState({}); | const [transactionData, setTransactionData] = React.useState({}); | ||||
| @@ -39,17 +37,16 @@ const Index = () => { | |||||
| const [onReady, setOnReady] = React.useState(false); | const [onReady, setOnReady] = React.useState(false); | ||||
| const updatePaymentApi = "/api/payment/updatepayment"; | const updatePaymentApi = "/api/payment/updatepayment"; | ||||
| const paymentStatusApi = "/api/payment/status/"; | const paymentStatusApi = "/api/payment/status/"; | ||||
| let webtoken = ""; | |||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| console.log("webtoken: "+localStorage.getItem("webtoken")); | |||||
| if (localStorage.getItem("webtoken") != null && localStorage.getItem("webtoken") != "") { | if (localStorage.getItem("webtoken") != null && localStorage.getItem("webtoken") != "") { | ||||
| webtoken = localStorage.getItem("webtoken"); | |||||
| localStorage.removeItem("webtoken"); | |||||
| loadForm(); | loadForm(); | ||||
| }else{ | |||||
| navigate("/dashboard"); | |||||
| } | } | ||||
| // else{ | |||||
| // navigate("/dashboard"); | |||||
| // } | |||||
| }, []); | }, []); | ||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| @@ -110,10 +107,11 @@ const Index = () => { | |||||
| url: paymentPath + paymentStatusApi + transactionid, | url: paymentPath + paymentStatusApi + transactionid, | ||||
| params: { | params: { | ||||
| "apprefid": transactionid, | "apprefid": transactionid, | ||||
| "webtoken": webtoken, | |||||
| "webtoken": localStorage.getItem("webtoken"), | |||||
| }, | }, | ||||
| onSuccess: function (responseData) { | onSuccess: function (responseData) { | ||||
| setResponeDataData(responseData) | setResponeDataData(responseData) | ||||
| localStorage.removeItem("webtoken"); | |||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||