|
@@ -9,7 +9,8 @@ import {ROUTE_PATH} from "@constants/routes";
|
|
|
import {reqGameInfo} from "@features/api";
|
|
import {reqGameInfo} from "@features/api";
|
|
|
const i18n=global.i18n;
|
|
const i18n=global.i18n;
|
|
|
const objInfo={
|
|
const objInfo={
|
|
|
- bt:null
|
|
|
|
|
|
|
+ bt:null,
|
|
|
|
|
+ timer:null
|
|
|
}
|
|
}
|
|
|
const WSport=({})=>{
|
|
const WSport=({})=>{
|
|
|
const {isMobile}=useThemeProvider();
|
|
const {isMobile}=useThemeProvider();
|
|
@@ -20,7 +21,7 @@ const WSport=({})=>{
|
|
|
const language=i18n.language;
|
|
const language=i18n.language;
|
|
|
const navigate=useNavigate();
|
|
const navigate=useNavigate();
|
|
|
const dispatch=useDispatch();
|
|
const dispatch=useDispatch();
|
|
|
- const {pathname} = 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 [sportPath,setSportPath]=useState(tempSPath)
|
|
const [sportPath,setSportPath]=useState(tempSPath)
|
|
|
const refreshToken=async ()=>{
|
|
const refreshToken=async ()=>{
|
|
@@ -84,6 +85,12 @@ const WSport=({})=>{
|
|
|
objInfo.bt=null;
|
|
objInfo.bt=null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ const clearTimer=()=>{
|
|
|
|
|
+ if (objInfo.timer!=null){
|
|
|
|
|
+ clearTimeout(objInfo.timer);
|
|
|
|
|
+ objInfo.timer=null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
useEffect(()=>{
|
|
useEffect(()=>{
|
|
|
if (pathname.startsWith(ROUTE_PATH.SPORTS)){
|
|
if (pathname.startsWith(ROUTE_PATH.SPORTS)){
|
|
|
let sub=pathname.replace(ROUTE_PATH.SPORTS,"");
|
|
let sub=pathname.replace(ROUTE_PATH.SPORTS,"");
|
|
@@ -107,6 +114,18 @@ const WSport=({})=>{
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},[pathname])
|
|
},[pathname])
|
|
|
|
|
+ useEffect(()=>{
|
|
|
|
|
+ if (hash===""){
|
|
|
|
|
+ clearTimer();
|
|
|
|
|
+ objInfo.timer=setTimeout(()=>{
|
|
|
|
|
+ if (objInfo.bt){
|
|
|
|
|
+ objInfo.bt.updateOptions({
|
|
|
|
|
+ url:sportPath
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },20);
|
|
|
|
|
+ }
|
|
|
|
|
+ },[hash])
|
|
|
useEffect(()=>{
|
|
useEffect(()=>{
|
|
|
if (objInfo.bt){
|
|
if (objInfo.bt){
|
|
|
if (bbConf==null)return null;
|
|
if (bbConf==null)return null;
|
|
@@ -131,6 +150,7 @@ const WSport=({})=>{
|
|
|
objInfo.bt=initBetby();
|
|
objInfo.bt=initBetby();
|
|
|
return ()=>{
|
|
return ()=>{
|
|
|
clearBT();
|
|
clearBT();
|
|
|
|
|
+ clearTimer();
|
|
|
}
|
|
}
|
|
|
},[userID])
|
|
},[userID])
|
|
|
//,theme,language
|
|
//,theme,language
|