|
@@ -14,12 +14,21 @@ import {APP_THEME} from "@constants/app";
|
|
|
import {useLocation, useNavigate} from "react-router-dom";
|
|
import {useLocation, useNavigate} from "react-router-dom";
|
|
|
import {ROUTE_PATH} from "@constants/routes";
|
|
import {ROUTE_PATH} from "@constants/routes";
|
|
|
import {reqGameInfo} from "@features/api";
|
|
import {reqGameInfo} from "@features/api";
|
|
|
|
|
+import {getUrlParam} from "@utils/helpers";
|
|
|
const i18n=global.i18n;
|
|
const i18n=global.i18n;
|
|
|
const objInfo={
|
|
const objInfo={
|
|
|
bt:null,
|
|
bt:null,
|
|
|
timer:null
|
|
timer:null
|
|
|
}
|
|
}
|
|
|
-const WSport=({})=>{
|
|
|
|
|
|
|
+const checkStartPath=(pathname)=>{
|
|
|
|
|
+ let path=pathname.startsWith(ROUTE_PATH.RACING)?"/horse-racing-55":"/";
|
|
|
|
|
+ let bt_path=getUrlParam("bt-path");
|
|
|
|
|
+ if (bt_path!=null&&bt_path!==""){
|
|
|
|
|
+ path=bt_path;
|
|
|
|
|
+ }
|
|
|
|
|
+ return path;
|
|
|
|
|
+}
|
|
|
|
|
+const WSport=({resetSport})=>{
|
|
|
const {isMobile}=useThemeProvider();
|
|
const {isMobile}=useThemeProvider();
|
|
|
const bbConf=useSelector(getBBConf);
|
|
const bbConf=useSelector(getBBConf);
|
|
|
const {theme}=useThemeProvider();
|
|
const {theme}=useThemeProvider();
|
|
@@ -29,7 +38,8 @@ const WSport=({})=>{
|
|
|
const navigate=useNavigate();
|
|
const navigate=useNavigate();
|
|
|
const dispatch=useDispatch();
|
|
const dispatch=useDispatch();
|
|
|
const {pathname,hash} = useLocation();
|
|
const {pathname,hash} = useLocation();
|
|
|
- const tempSPath=pathname.startsWith(ROUTE_PATH.RACING)?"/horse-racing-55":"/";
|
|
|
|
|
|
|
+ // const tempSPath=pathname.startsWith(ROUTE_PATH.RACING)?"/horse-racing-55":"/";
|
|
|
|
|
+ const tempSPath=checkStartPath(pathname);
|
|
|
const [sportPath,setSportPath]=useState(tempSPath);
|
|
const [sportPath,setSportPath]=useState(tempSPath);
|
|
|
const btToken=useSelector(getUserBBToken);
|
|
const btToken=useSelector(getUserBBToken);
|
|
|
const userLang=useSelector(getUserLang);
|
|
const userLang=useSelector(getUserLang);
|
|
@@ -87,7 +97,10 @@ const WSport=({})=>{
|
|
|
onRecharge:function (){
|
|
onRecharge:function (){
|
|
|
navigate(ROUTE_PATH.PAY);
|
|
navigate(ROUTE_PATH.PAY);
|
|
|
},
|
|
},
|
|
|
- onSessionRefresh: function() {},
|
|
|
|
|
|
|
+ onSessionRefresh: function() {
|
|
|
|
|
+ // resetBT();
|
|
|
|
|
+ if (resetSport)resetSport();
|
|
|
|
|
+ },
|
|
|
onBetSlipStateChange: function() {}
|
|
onBetSlipStateChange: function() {}
|
|
|
})
|
|
})
|
|
|
return bt;
|
|
return bt;
|
|
@@ -158,9 +171,12 @@ const WSport=({})=>{
|
|
|
// })
|
|
// })
|
|
|
// }
|
|
// }
|
|
|
// },[language])
|
|
// },[language])
|
|
|
- useEffect(()=>{
|
|
|
|
|
|
|
+ const resetBT=()=>{
|
|
|
clearBT();
|
|
clearBT();
|
|
|
objInfo.bt=initBetby();
|
|
objInfo.bt=initBetby();
|
|
|
|
|
+ }
|
|
|
|
|
+ useEffect(()=>{
|
|
|
|
|
+ resetBT();
|
|
|
return ()=>{
|
|
return ()=>{
|
|
|
clearBT();
|
|
clearBT();
|
|
|
clearTimer();
|
|
clearTimer();
|